1

So I have Python basically connected to google sheets at the moment. It can access the first sheet and read and write data:

sheet = client.open("Remake").sheet1

I can access sheet 1 inside the overarching spreadsheet, but I cannot access the second sheet (sheet2) by just changing it to:

sheet = client.open("Remake").sheet2
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Trunks159
  • 91
  • 9

2 Answers2

4

To explain this, it is because Google Spreadsheet only implemented sheet1 to let you retrieve the first sheet in your spreadsheet as a shortcut. So if you want to retrieve other sheets, you need to use other methods like:

wks = gc.open("doc_name").get_worksheet(index)

or

wks = gc.open("doc_name").worksheet(title)

Related infos:

Jessica Rodriguez
  • 2,899
  • 1
  • 12
  • 27
0

In my case this code working (python 3.7)

Spreadsheet  = client.open("sheet_name").worksheet("sheet_title")
Hassan
  • 123
  • 1
  • 2
  • 11