2

I want to create download link for my spreadsheet on google drive and I read about something like that:

https://docs.google.com/spreadsheets/d/MY_SPREADSHEET/export?format=csv

But it only downloads first sheet. I've read about GID parameter, but I don't want to spend time developing something that will get all GID's from API, and then download every sheet. Is there any way to have one link that leads to download of whole spreadsheet?

1 Answer 1

9

You might want to try suggestion in Labnol's guide:

Open your Google Spreadsheet in the browser, make the sheet Public (or Anyone with a link) and make a note of the shared URL. It should be something like this:

https://docs.google.com/spreadsheets/d/FILE_ID/edit?usp=sharing

The direct download links use a similar format as Google Documents and will read like:

https://docs.google.com/spreadsheets/d/FILE_ID/export?format=xlsx https://docs.google.com/spreadsheets/d/FILE_ID/export?format=pdf

In addition to that, you may want to also try using the suggested URL in this SO post and see if it will help.

https://docs.google.com/spreadsheets/u/1/d/${id}/export?format=csv&id=${id}&gid=${gid}
2
  • 1
    Thanks. I see that when downloading formar=csv, then it downloads only first sheet, but when using xlsx, then it downloads whole spreadsheet. That's what I wanted.
    – Dodzik
    Dec 12, 2016 at 8:39
  • Did t his stop working in 2022?
    – CPBL
    Apr 3, 2022 at 21:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.