Excelpromax123
Board Regular
- Joined
- Sep 2, 2021
- Messages
- 167
- Office Version
- 2010
- Platform
- Windows
Hello everyone. I need help how to fix the below code to open Google Drive program when the path changes frequently
C:\Program Files\Google\Drive File Stream and GoogleDriveFS.exe : Stand still
50.0.11.0 : Usually change
I want to fix it, if I change the path at 50.0.11.0 , the code will still run . Or can you advise me a code that opens a program regardless of the path. Thank you very much
C:\Program Files\Google\Drive File Stream and GoogleDriveFS.exe : Stand still
50.0.11.0 : Usually change
I want to fix it, if I change the path at 50.0.11.0 , the code will still run . Or can you advise me a code that opens a program regardless of the path. Thank you very much
VBA Code:
Sub openprogram()
On Error Resume Next
Dim Shex As Object
Set Shex = CreateObject("Shell.Application")
tgtfile = "C:\Program Files\Google\Drive File Stream\50.0.11.0\GoogleDriveFS.exe" ' address
Shex.Open (tgtfile)
MsgBox ("run")
End Sub