I have built this macro using Excel 365 64-bit.I am using 64 bit windows 10 OS.
Hi @Dan_W - if you are interested in developing VBA solutions for working with OneDrive + SharePoint + Excel on the web (which are parts of Microsoft Graph API) or Google Sheets or Notion API, please create a new thread with questions, I will be happy to assist you.Hi both - I suspect the issue may be the with the MSCOMCTL control. As Nguyendang points out, Microsoft has fixed issues related to the related controls (Listview, Treeview, and ProgressBar), but the real issue is that they didn't really tell anyone about it (save for a very forgettable news release back in 2016). I wrote a post about it here - it includes information on (the very unexpected) location of the control on your hard drive.
As for your workbook, @nguyendang, I've loaded it without any problems so far. I haven't gone through the process of getting the API key yet, but I don't anticipate any difficulties. I will let you know if I encounter any, but thank you so very much for sharing this solution - I'm sure a quick search of this forum will reveal that there are many people who have been asking for something like this. If you ever get bored and feel an inexplicable desire to do one for OneDrive too, the masses will surely love you!
Hi!I re-uploaded the .xlam file as you requested.
GoogleDriveAPI.xlam
You can call this method with alt=media to download a file stored in Drive. However, my .xlam add-in doesn't work with Excel 2016 or earlier so you need to upgrade to at least Excel 2019 or later to use this add-in.Hi!
Please, help me!
The API is too complicated for me
A want to download one or more files (listed in Excel (2016) worksheet's cells: "C64389 01.txt", "C65211 0003.txt" etc.) from Google Drive's directory named "JVBK" into my PC's specific folder.
I don't know what functions/procedures I need from the API
Can you help me?
Hi!You can call this method with alt=media to download a file stored in Drive. However, my .xlam add-in doesn't work with Excel 2016 or earlier so you need to upgrade to at least Excel 2019 or later to use this add-in.
This add-in provides the Download method in the FilesResource class module which allows you to download any file stored in Drive by FileID.
View attachment 96063
Well, the problem is that Google Drive manages files and folders by ID, not name, so multiple files can have the same name and extension (i.e, .xlsx) in a folder but each of them must have a different ID. Therefore, you must specify an ID so that Google Drive knows what file you want to download.Hi!
Thanks for your reply, but this function use fileid too
I need a code that only needs the file name to download.
One where I enter the names of the files in the cells, and then the download takes place into a specified folder at the press of a button.
for example: download(File:="../JVBK/C65894 002.txt", Dest_Folder:="c:\downloads\JVBK_Files\")
Can you help me with this?
I saw that it is possible to create a JSON string based on the contents of a folder, which contains both the ID and the name of the file. If I received that JSON string, I could process it and extract the necessary information from it.Well, the problem is that Google Drive manages files and folders by ID, not name, so multiple files can have the same name and extension (i.e, .xlsx) in a folder but each of them must have a different ID. Therefore, you must specify an ID so that Google Drive knows what file you want to download.
What are the steps for using it? Please advise me. Thank you very much.You need to implement Google Drive API.
Unfortunately, Google does not provide any client library for VBA, so I have written one on my own.
For example, design a simple userform that:
View attachment 87660
- Uploads/download file.
- Lists all Google Drive files in tree view.
GoogleDriveAPI.xlam