Run an EXE

JohnPapa

Registered User.
Local time
Today, 09:10
Joined
Aug 15, 2010
Messages
1,020
In the Target of a shortcut I run the following .exe successfully

"C:\Program Files (x86)\VATECH\EzDent-i\Bin\VTE2Loader_ReqAdmin32.exe"

When I try to execute the same with Shell,

Code:
    Dim myPath2 As String
    myPath2 = "C:\Program Files (x86)\VATECH\EzDent-i\Bin\VTE2Loader_ReqAdmin32.exe"
    Call Shell(myPath2, 1)

I receive Run time error 5
Invalid Procedure Call or Argument
 
In VBA, executing a shell command with spaces in the path requires enclosing the path in double quotes. Here’s how you can do it in MS Access VBA:
Code:
myPath2 = """C:\Program Files (x86)\VATECH\EzDent-i\Bin\VTE2Loader_ReqAdmin32.exe"""
 
Last edited:
I had tried this before

Code:
    Dim myPath2 As String
    myPath2 = """C:\Program Files (x86)\VATECH\EzDent-i\Bin\VTE2Loader_ReqAdmin32.exe"""
    Call Shell(myPath2, 1)

Same problem
 
I just tested your same code with notepad.exe path, and it worked fine. check your path for correctness
 
The following works

CreateObject("Shell.Application").Open ("C:\Program Files (x86)\VATECH\EzDent-i\Bin\VTE2Loader_ReqAdmin32.exe")
 

Users who are viewing this thread

Back
Top Bottom