I need to open one or other exe file if it is installed
If the PC is 32 bit the file will be in C:\Programs Files\myfolder\filename.exe
If the PC is 64 bit the file will be in C:\Programs Files(x86)\myfolder\filename.exe
So far I have tried a combination of the following using the Shell function and failed. please email me if solution found
drilling@maltanet.net
Thanks
Private Sub CommandButton13_Click()
On Error GoTo NoCanDo1
Dim MyAppID, ReturnValue
Dim RetVal
MyAppID = Shell("C:\Program Files\myfolder\filename.exe", 1) ' Run 32 bit 2010 if file found and exit sub.
Exit Sub
NoCanDo1:
On Error GoTo NoCanDo2
Dim MyAppID, ReturnValue
Dim RetVal
ReturnValue = Shell("C:\Program Files (x86)\myfolder\filename.exe", 1) ' Run 64 bit 2010 if file found and exit sub.
Exit Sub
NoCanDo2:
On Error GoTo continue
continue:
UserFormmyfile.Show 'shows a form with details if file not installed
End Sub
If the PC is 32 bit the file will be in C:\Programs Files\myfolder\filename.exe
If the PC is 64 bit the file will be in C:\Programs Files(x86)\myfolder\filename.exe
So far I have tried a combination of the following using the Shell function and failed. please email me if solution found
drilling@maltanet.net
Thanks
Private Sub CommandButton13_Click()
On Error GoTo NoCanDo1
Dim MyAppID, ReturnValue
Dim RetVal
MyAppID = Shell("C:\Program Files\myfolder\filename.exe", 1) ' Run 32 bit 2010 if file found and exit sub.
Exit Sub
NoCanDo1:
On Error GoTo NoCanDo2
Dim MyAppID, ReturnValue
Dim RetVal
ReturnValue = Shell("C:\Program Files (x86)\myfolder\filename.exe", 1) ' Run 64 bit 2010 if file found and exit sub.
Exit Sub
NoCanDo2:
On Error GoTo continue
continue:
UserFormmyfile.Show 'shows a form with details if file not installed
End Sub
Last edited: