new owner to google sheet, link to button broken.

264 views
Skip to first unread message

Rick Sutton

unread,
Oct 7, 2022, 12:59:16 PM10/7/22
to Google Apps Script Community
Hello. I was added as new owner of a sheet and it had a script added to a button which was work fine before. we tired to run the script the button and get :  Script function copyOnlineDataToDb could not be found. script runs fine in editor.  any clues.

Thanks in advance

Bennett, Scott

unread,
Oct 7, 2022, 1:01:18 PM10/7/22
to google-apps-sc...@googlegroups.com
This is just a guess.  Make sure you sign out of all accounts and then sign back into the one that you are using to run the script.  

On Fri, Oct 7, 2022 at 11:59 AM Rick Sutton <rsutto...@gmail.com> wrote:
Hello. I was added as new owner of a sheet and it had a script added to a button which was work fine before. we tired to run the script the button and get :  Script function copyOnlineDataToDb could not be found. script runs fine in editor.  any clues.

Thanks in advance

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/fec4d7b5-61e9-40c0-84d5-0a7d6698d68fn%40googlegroups.com.


--
Scott Bennett


Rick Sutton

unread,
Oct 7, 2022, 1:20:28 PM10/7/22
to Google Apps Script Community
lol thanks, but i am new to all this and it is one of those thing that are thrown in your lap to do.
so how would i kick everyone out and sign back in.  I am running it as me the owner and I also had another person try to run it.
they have editor rights.

CBMServices Web

unread,
Oct 7, 2022, 1:26:52 PM10/7/22
to google-apps-sc...@googlegroups.com
I suspect the most likely cause is that the script calls on an external script library file that you do not have access to. Speak to the previous owner and ask him to ensure he enables access to the library for you.


Bennett, Scott

unread,
Oct 7, 2022, 1:26:52 PM10/7/22
to google-apps-sc...@googlegroups.com
No, you need to sign out of all the Google accounts of the person trying to run it.  
For example, I have people that are signed in to both their work account and personal account. 
Then when they go to run the function, the accounts are conflicting since only one account has the rights to do it.  
Whomever is trying to run it, make sure they are only signed into the google account that has access.  
Basically, click on the account at the top right and select sign out of all accounts, then sign in to the one that should run the code.

If they only have one account, then I am not sure what is going on.

Rick Sutton

unread,
Oct 7, 2022, 1:37:27 PM10/7/22
to Google Apps Script Community
thanks.  they are all in with their work accts. the previous owner no longer works here he only had this one file which I transferred ownership.
I can edit all , add users etc but get the script to run with the button in the sheet.
the library is empty I didn't any call to (sendmail) in code or macros.  assign a script has a diff name. 



Capture.JPG

CBMServices Web

unread,
Oct 7, 2022, 1:39:09 PM10/7/22
to google-apps-sc...@googlegroups.com
I can take a look for you if you want. Add me as an editor and I can let you know.


Rick Sutton

unread,
Oct 7, 2022, 2:59:46 PM10/7/22
to Google Apps Script Community
question does the code and macro function have to have the same name? the error msg ::::: Script function copyOnlineDataToDb could not be found when click on 
add to database button. I have closed and when back in and the same thing.  owner ship transferred to me .
No data in library and run fine with no errors in appscript. also in app script the project name is:::::sendmail.

Thank you for your help I will check back. 

cell1.JPGmacro1.JPGcode1.JPG

CBMServices Web

unread,
Oct 7, 2022, 3:16:11 PM10/7/22
to google-apps-sc...@googlegroups.com
No. the files code.gs and macros.gs should be different names and not the same.

The script specified by the button needs to be identical to the script function name. Superficially looking from the picture you posted, they look the same. But can't tell if there are any spaces added or not somewhere which may be causing problems..

 What you can do is remove the script function name from the button (right click button, then click on the 3 dots and choose assign script and then delete what is there). The double click the function name copyOnlineDataToDb from the code and then paste it into the button (Assign Script). Do not put any parentheses there. 

You can also look to ensure that the function defined in the code is being well defined by checking to see if Google recognizes it as a function (click the down arrow besides the run/debug and see if that function is present in the dropdown list.

 Good luck.

Rick Sutton

unread,
Oct 11, 2022, 8:03:26 AM10/11/22
to Google Apps Script Community
Morning Hope you had a great weekend. I have done the above that Mr. George suggested and the following.

1. sheet and script, was owned by employee who left.   I logged into his google and changed the ownership of the sheet to me nothing else
2. it is a monthly back that I am assigned to do, so went to sheet did the back up and there is a step to data to database. (script)
3. click the button and no script found.  ran the script no errors completed fine.  add the script to button no spaces no parentheses.
still came back with error.

I saw somewhere where it said to have the script authorize.  Don't know if that was broken when I took ownership of the sheet.?
as it doesn't work for any of the 15 people who have edit rights including me. we can do it manually and it work fine also.
bummmm.JPG
log.JPG
Reply all
Reply to author
Forward
0 new messages