Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Need help trying to get a script t o run [closed]

$
0
0

I am running a script to check for the last number and get a value to move up by one. I have done a similar code before without issues, but for some reason I am getting errors on checking if the first portion is running correctly. I have check that the SheetName is correct.Here is a copy of the simple code

function generateEmpID() {SpreadsheetApp.getActiveSpreadsheet().getSheetByName("EmpID").getRange(2,1).getValue();console.log(SpreadsheetApp.getActiveSpreadsheet().getSheetByName("EmpID").getRange(2,1).getValue());}

And this is the response I get:

12:01:35 PM Notice Execution started
12:01:36 PM Error TypeError: Cannot read property 'getSheetByName' of nullgenerateEmpID @ Code.gs:3


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>