missing function?

109 views
Skip to first unread message

Steve Gill

unread,
Dec 28, 2021, 4:04:03 PM12/28/21
to Google Apps Script Community
Hi;

1) Just learning Google App Script, in an excercise, it call for getSheetByName, it is no longer available??

I went to the documentation, and it still discusses it, so not sure by it won't let me use it..

2) Also, is script editor no longer available from the sheets drop down menus? The only option I see is Extensions, Apps Script? 


getSheetbyName error.PNG
Capture.PNG

Jonathan Butler

unread,
Dec 28, 2021, 4:14:52 PM12/28/21
to google-apps-sc...@googlegroups.com
You are getting the active sheet already. There is no getSheetByName function in the sheet object. I think you meant to put getActive() in line 25.

--
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/3c1141dc-fc06-405a-bbba-30cf21751004n%40googlegroups.com.

CBMServices Web

unread,
Dec 28, 2021, 4:15:32 PM12/28/21
to google-apps-sc...@googlegroups.com
Share your code and we can help point you in the right direction.

Yes, the script editor launch button was moved to extentions.


CBMServices Web

unread,
Dec 28, 2021, 4:17:31 PM12/28/21
to google-apps-sc...@googlegroups.com
Noticed the images after I replied.

Getsheetbyname is a function on a spreadsheet and not on a sheet.

Change the ss to be getactiveSpreadsheet instead and it should work.

On Tue., Dec. 28, 2021, 1:04 p.m. Steve Gill, <steve...@gmail.com> wrote:

Steve Gill

unread,
Dec 30, 2021, 9:04:53 PM12/30/21
to Google Apps Script Community
Thanks George and Jon; that did the trick. 
Reply all
Reply to author
Forward
0 new messages