Search code examples
worksheetpygsheets

How to create a pygsheets worksheet without the default sheet1?


Is there a way to create a pygsheets worksheet without the default sheet1?

Looking through the documentation didn't help, but googling seems to indicate that it's possible to eliminate sheet1 in excel, so presumably, it should be possible in pygsheets.


Solution

  • sheet1 just refers to the first sheet which is automatically created when you creates the spreadsheet. It is automatically created by google sheets and you can't control it from any library. google sheets required you to have at-least one worksheet in a spreadsheet. So you cannot remove all the sheets.

    But if you just want to remove the sheet named sheet1, you can do

    sh.del_worksheet(sh.sheet1)
    

    or if you wanna rename it , you can do

    sh.sheet1.title="new_sheet"