Conor Calby
Conor Calby

Reputation: 1

Excel Macro to Open EXE

I am trying to create a macro that will open the file "test.exe" on drive F/. I get "runtime error 5" when running this code below.

Sub MacroTangoMike()
' MacroTangoMike Macro
RetVal = Shell("F:/test.exe", 1)
End Sub

It works fine though if test.exe is on the C/ drive.

Upvotes: 0

Views: 3671

Answers (1)

NYCdotNet
NYCdotNet

Reputation: 4647

Error 5 is access denied. Are you sure you have the execute permission on the EXE on the F: drive?

Also you should probably be using backslashes \ in your paths on Windows rather than /.

Upvotes: 1

Related Questions