I am trying to access Google spreadsheets using a spreadsheet example. When I run the example code it worked fine. I just change the SpreadsheetId and range
If you look at the sheet itself you will notice that the Worksheet is titled "Class Data". So just put the name of your sheet where is says "Class Data". Example: String range = "SheetName!A1:C";
String range = "Class Data!A2:A4";
The Class Data
is your worksheet's name, FYI: the name on the tab at the bottom, the default one is "Sheet1". Replace Class Data
with the one you want to work with.
Try replacing Class Data!A2:A4
with A2:A4
I ran into this error when I had a typo in the name of the tab. In your case "Class Data" didn't match the name of the tab
I was trying to add some data to a sheet named Emmett
that did not existed yet and was receiving this error:
Error: Unable to parse range: Emmet!A2:C12
I had to manually create the sheet named Emmett
in the spreadsheet and then it worked like a charm.
In my case there was an extra space in the google sheet while I was trimming the sheet name at my end. Once I removed the trimming logic, everything worked fine.