0

I'm having a hard time implementing a script using Google Script to export and download a spreadsheet. First, I create the spreadsheet using the Google Drive API, which is completed successfully. Then I'm trying to export the spreadsheet to a Microsoft Excel document and download it using the Google Drive API. I've tried the HTTP request (link below) and also calling the method export from the API. The best I've got is a 200 response from the HTTP request but no download at all. I ran out of ideas and tests.

Please, any suggestion or solution will be highly appreciated!

Thanks in advance!

https://www.googleapis.com/drive/v3/files/[SpreadsheetId]/export?mimeType=application%2Fvnd.openxmlformats-officedocument.spreadsheetml.sheet&alt=media&key=[MY_CLIENT_ID]

Drive.Files.export(spreadsheetId, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', {"alt":"media","client_secret":[client_secret_key]});
Cooper
  • 59,616
  • 6
  • 23
  • 54
  • 1
    About `Then I'm trying to export the spreadsheet to a Microsoft Excel document and download it using the Google Drive API.`, where do you want to download it to? – Tanaike Jan 22 '20 at 23:53
  • About Tanaike question, I want to download it to my computer -local Downloads folder-. My browser is Google Chrome, OS: Windows 10. – Jalex Diaz Jan 23 '20 at 14:15
  • 1
    Thank you for replying. In that case, is this thread useful? https://stackoverflow.com/q/37212135/7108653 – Tanaike Jan 23 '20 at 23:29
  • Thanks a lot, @Tanaike. That thread did help me. Several days struggling with that issue. – Jalex Diaz Jan 24 '20 at 00:59
  • Thank you for replying. I'm glad your issue was resolved. – Tanaike Jan 24 '20 at 01:03

0 Answers0