2
votes

as I'm not a web developer by any means, this is me just asking a question for that I have not found a solution for. I have a google sheet with multiple pages/sheets within it. the file is embeded in an iframe inside a webpage and I pulled the url and can open it directly using the url. the following link is just an example as I can't share the actual link since I am not allowed to:

https://docs.google.com/spreadsheets/d/e/{key}/pubhtml?widget=true&headers=false

I have tried this: https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key={key}

and is not working I get an error:

Sorry, unable to open the file at present.

Please check the address and try again.

the file is not meant for anyone to download nor share. Furthremore, since it is continuosely manually updated by author and I need to keep track of updates, taking screenshots is not efficient since the file is too big. is there any way I can download the actual sheet to my device (so I can compare file updates over the long run) Thank you.

1
Your title is Download embeded google sheets. But in your question, it says the file is not meant for anyone to download nor share. and is there any way I can download the actual sheet to my device. Unfortunately, I cannot understand about your question. I apologize for my poor English skill. Can I ask you about the detail of your current issue and your goal?Tanaike
Yes hello and thank you for commenting, yes I want to ``` download embeded google sheet``` and that document is not meant for download since when you open the embeded document you will not get a toolbar at the top which gives you the ability to download and/or share. but since the file is open on my device on my browser, I assume that there is a way I can pull it so is there any way I can download the sheet? Thank you.laminar Flow
Thank you for replying. From your replying, I have 2 questions. 1. Is the Spreadsheet publicly shared or published as the Web publish? Or both? 2. Have you already known the Spreadsheet ID?Tanaike
sorry for being late, I only have the linke to the web published spreadsheet and looks something like this ( a spreadsheet I made ):docs.google.com/spreadsheets/d/e/…laminar Flow
Thank you for replying. From your replying, I proposed an answer. Could you please confirm it? If I misunderstood your goal, I apologize.Tanaike

1 Answers

4
votes

I believe your goal as follows.

  • You want to download a Google Spreadsheet.
  • You are the owner of Google Spreadsheet.
  • The Spreadsheet is published as the Web publish. So the URL of Spreadsheet is https://docs.google.com/spreadsheets/d/e/2PACX-1vTl9bcwMSjoxYj406evzJefFodkVEUlV2KIq34Y5V8BFWJygAFrPSA7L5d89TASDUjkPG4b2SfN2rpe/pubhtml?widget=true&headers=false.

Issue and workaround:

Unfortunately, the Google Spreadsheet cannot be directly downloaded as the Google Spreadsheet. It seems that this is the current specification. In this case, it is required to export the Google Spreadsheet as other mimeType. For example, it's XLSX format, PDF format and CSV format. But the URL of https://docs.google.com/spreadsheets/d/e/2PACX-1vTl9bcwMSjoxYj406evzJefFodkVEUlV2KIq34Y5V8BFWJygAFrPSA7L5d89TASDUjkPG4b2SfN2rpe/pubhtml?widget=true&headers=false cannot directly export. So, in this answer, as a workaround, I would like to propose to use the URL for exporting Google Spreadsheet as other mimeType.

When your URL is used, the URL for exporting is as follows.

Modified url:

https://docs.google.com/spreadsheets/d/e/2PACX-1vTl9bcwMSjoxYj406evzJefFodkVEUlV2KIq34Y5V8BFWJygAFrPSA7L5d89TASDUjkPG4b2SfN2rpe/pub?output=xlsx
  • In this case, when you access to above URL using browser, your Spreadsheet can be exported as a XLSX file.

  • When output=xlsx is modified to output=pdf and output=csv, you can export as a PDF file and a CSV file, respectively.

  • When you want to export the specific sheetm please use the sheet ID like gid=0. The URL is as follows.

      https://docs.google.com/spreadsheets/d/e/2PACX-1vTl9bcwMSjoxYj406evzJefFodkVEUlV2KIq34Y5V8BFWJygAFrPSA7L5d89TASDUjkPG4b2SfN2rpe/pub?output=xlsx&gid=0
    

Note:

  • When you want to make users downloading the Spreadsheet, you can add the tag a as follows.

      <a href="https://docs.google.com/spreadsheets/d/e/2PACX-1vTl9bcwMSjoxYj406evzJefFodkVEUlV2KIq34Y5V8BFWJygAFrPSA7L5d89TASDUjkPG4b2SfN2rpe/pub?output=xlsx">Download</a>