Solved How can i upload or download a file from Google Drive In VBA ? (1 Viewer)

VBANewBie :)

Member
Local time
Today, 23:33
Joined
Apr 14, 2021
Messages
88
Hi guys , As the title i need to download and upload files directly to google drive with vba code without using synchronize folder as it will be used on different PCs .
Thanks in advance
 

Gasman

Enthusiastic Amateur
Local time
Today, 22:33
Joined
Sep 21, 2011
Messages
14,277
Google drive has a mapped letter?
 

VBANewBie :)

Member
Local time
Today, 23:33
Joined
Apr 14, 2021
Messages
88
Hello again , I got this example and got all the needed credentials but i get this error when it tries to connect to google account , can anyone help ?
1.png


2.png


these are current references , Any missing ?
3.png

Thanks guys
 

Attachments

  • democAuth.mdb
    808 KB · Views: 312

Gasman

Enthusiastic Amateur
Local time
Today, 22:33
Joined
Sep 21, 2011
Messages
14,277
I cannot even open the DB?

Tried again and did manage to get it open. You did not say what to use to get the error :(

I tried opening FrmGdrive and got
1644511221336.png
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 22:33
Joined
Sep 21, 2011
Messages
14,277
No it tells me it will lose all the modules as the VBA project is corrupt or to that effect.

Get it compiled first then upload again.
 

VBANewBie :)

Member
Local time
Today, 23:33
Joined
Apr 14, 2021
Messages
88
I compiled it with no errors and saved as accdb try it , The both of them work fine
 

Attachments

  • democAuthNew.accdb
    964 KB · Views: 337
  • democAuth.mdb
    812 KB · Views: 274

VBANewBie :)

Member
Local time
Today, 23:33
Joined
Apr 14, 2021
Messages
88
Decompiled with vbs script then compiled again
 

Attachments

  • Decompiled then compiled.mdb
    812 KB · Views: 318

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 16:33
Joined
Feb 28, 2001
Messages
27,175
Looking at your Tools >> References exhibit, I suspect part of the problem is that you don't have a Google library checked. I would think that a method as specific as .LogOnGoogle user, password would have to be part of a vendor-specific (i.e. Google) references library, which means you would have to check it in your references list. I would be astounded to find that a .LogOnGoogle method was available from any of the "standard" Access libraries.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:33
Joined
Oct 29, 2018
Messages
21,469
Looking at the sample file, .LogOnGoogle is a method of the gAuth2 class. Maybe the error is actually within that method. Just a thought...
 

VBANewBie :)

Member
Local time
Today, 23:33
Joined
Apr 14, 2021
Messages
88
you don't have a Google library checked
Thanks for your reply , I searched my references and didn’t find any google and also the person who shared the example didn’t mention any special library .
I don’t know what to do :(
 

Gasman

Enthusiastic Amateur
Local time
Today, 22:33
Joined
Sep 21, 2011
Messages
14,277
You can create all this code, yet cannot carry out simple debugging? :(
Ah wait, you didn't create it, just copied it?, but still had to modify to suit, surely?

Your error is here as shown below in LogOnGoogle

You have On Error Goto ErrorHandler in some subs/functions which just exits the sub/function? :(

How are you meant to determine where any error is?


1644514718587.png
 
Last edited:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 16:33
Joined
Feb 28, 2001
Messages
27,175
After further research, I found this article that names a file you could try to find. It was for another environment, but it seems similar.


Otherwise, since you are obviously a cloud-service customer you should be able to call their help desk and ask for the name of (and a source of) the required .DLL file that would satisfy those references.
 

Gasman

Enthusiastic Amateur
Local time
Today, 22:33
Joined
Sep 21, 2011
Messages
14,277
The code just grinds my laptop to a halt.

Edge opens instead of IE

Even when I know where to put the breakpoint at?

Puzzled as to why I cannot see the objects like olExplorer?

This is beyond my pay grade :(
 

VBANewBie :)

Member
Local time
Today, 23:33
Joined
Apr 14, 2021
Messages
88
Ah wait, you didn't create it, just copied it?, but still had to modify to suit, surely?
I didn’t mention that i’m an expert or i did write this code , And sure i did my best trying to figure out what’s missing and i suspected it was a missing reference and it probably is .
thanks for your help
 

Users who are viewing this thread

Top Bottom