when Google spreadsheet is started (when spreadsheet is opened)
I'd like to run the gas I created in the script editor.
Either of the following methods will not work at startup:
On the script editor,
in the code .gs (default) script file
Write the following code and
If you do it individually, you can see that it works.
function test(){
Browser.msgBox("Hello!");
}
Close the Script Editor and Spreadsheet
when re-opening the spreadsheet
The message box should say "Hello!" but it doesn't.
I can't help it, so I'll delete the above trigger configuration
Rewrite the "test" function itself to "onOpen" as follows
function onOpen(){
Browser.msgBox("Hello!");
}
Close the script editor and spreadsheet in this state
when re-opening the spreadsheet
"Hello!" should be displayed in the message box.
There was still no message.
I think I'm following the proper procedure for both of them.
Is there a mistake somewhere?
(By the way, the account environment is for paid G suite users.)
If you have any idea of this phenomenon, please let me know.
google-apps-script
When I tried the code in my environment, both 1.2. worked.
There seems to be no particular problem.
To check where the problem is
Check Logger.log("hello!";
to see if the function itself is startedcheck for exceptions in try {Browser.msgBox("hello!");}catch(e){Logger.log(e);}
Why don't you check it like this?
© 2024 OneMinuteCode. All rights reserved.