Automated Sharing

753 views
Skip to first unread message

Luffy Heng

unread,
May 7, 2022, 11:28:43 AM5/7/22
to Google Apps Script Community
Hi all,
I wonder why this error keep coming out when I try to run the automated sharing.


Exception: Unexpected error while getting the method or property getFileById on object DriveApp.
222.png
anyone can help to check what's the problem here?
111.png
Many thanks!!!

Luffy Heng

unread,
May 7, 2022, 11:53:34 AM5/7/22
to Google Apps Script Community
I have the permission to that file.

Luffy Heng

unread,
May 7, 2022, 12:22:00 PM5/7/22
to Google Apps Script Community
after investigating, i realised the code capture the wrong fileID, e.g. https://docs.google.com/spreadsheets/d/1OMwlHZUIX-L28QNYCS.......hYD4ukrU/, the script only wants the middle part 1OMwlHZUIX-L28QNYCS.......hYD4ukrU, If i enter only the middle part into column 1 row 2, it works well. How do I modify the script to capture only the middle part so I don't have to do it manually?
Reply all
Reply to author
Forward
0 new messages