Function from script editor works fine but not from sheets custom function

前端 未结 2 862
广开言路
广开言路 2021-01-17 06:16

I wrote a function that adds an all-day event.

When the function running from script editor it\'s working fine, the all-day event is inserted to the calendar.

2条回答
  •  滥情空心
    2021-01-17 06:26

    That is because you are not allowed to use a custom function to perform actions that require authorization such as adding an event to your calendar.

    From the official documentation:

    Unlike most other types of Apps Scripts, custom functions never ask users to authorize access to personal data.

    However, there are some workarounds that you could try. For example, you can create a custom menu option within your spreadsheet file or a time-driven trigger.

提交回复
热议问题