Geoff Evans
Geoff Evans

Reputation: 21

Selecting a Sheet from within a Google workbook

As a newbie I am trying to create a Google Form with drop-down lists (in answer to questions), with those lists being obtained from named ranges in a separate google sheet in the Form responses Google workbook.

I have found a script that indicates how to do that but I believe I am coming across a syntax error I can't resolve.

The script gives me an error as:

ReferenceError: "setActiveSheet" is not defined. (line 43, file "Code")

The lines of code are,

42  ss = SpreadsheetApp.getActiveSpreadsheet();

43     setActiveSheet(ss.getSheetByName("DropDownLists"));

DropDownLists is the name of the Google sheet in the Form Returns Google workbook that I am trying to select

I hope someone can help and please be gentle, it's my first request for assistance

Thanks

Upvotes: 2

Views: 124

Answers (1)

Andrew Wood
Andrew Wood

Reputation: 51

setActiveSheet is a method of class SpreadsheetApp (https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app)

Please try changing line 43 to: SpreadsheetApp.setActiveSheet(ss.getSheetByName("DropDownLists"));

Upvotes: 1

Related Questions