1

Does anyone have an example of VBA code to automatically download a file from Google Drive. I can get to viewing the file in Chrome but then I have to manually select 'Download'. I would like to press a button and then pick the downloaded file from my default 'Download' folder. No in-between intervention.

Mike Eburne
  • 351
  • 2
  • 7
  • 21
  • One can integrate Google Drive into one's file system I'm sure. Then it becomes just another file one an access with Workbooks.Open – S Meaden Jun 08 '16 at 12:51
  • The files I want to download are PDF instructions to the Excel product I sell. I want a button in the spreadsheet that downloads the instructions file for that spreadsheet. The PDF is housed in a shared Google Drive folder. – Mike Eburne Jun 08 '16 at 12:54
  • 1
    If you control the file you are downloading, then you can get a public link from google docs and use this solution: http://stackoverflow.com/questions/17877389/how-do-i-download-a-file-using-vba-without-internet-explorer#17877390 –  Jun 08 '16 at 13:18

2 Answers2

0

One option would be to launch the users default web browser with a direct link to download your file from Google Drive, this would prompt the user to Save As / Open your user guide in the same way that it would if they clicked to download a PDF from a website and so might be sufficient.

This question's answer details how to open a url in browser, and you can use this website to create direct download links from Google Drive share links.

Carrosive
  • 889
  • 2
  • 10
  • 25
0

Using the 'GetspecialFolder' UDF, you can download files from any cloud drive as simple as:

FileCopy GetSpecialFolder(vbDirGoogleDrive) & "MyFile.DOC", GetSpecialFolder(vbDirDownloads) & "MyFile.DOC"

http://www.EXCELGAARD.dk/Lib/GetSpecialFolder/