I want to run an exe file from VBA with 2 parameters. To be more specific here is the exact line that works for me in command line (Win+R), I just need it in VBA:
C:\Program Files (x86)\MacroRecorder\MacroRecorder.exe "E:\test.mcr" /a
I tried so far:
Sub open_test_file()
Call Shell("C:\Program Files(x86)\MacroRecorder\MacroRecorder.exe 'E:\test.mcr' /a")
End Sub
And this:
Public Sub StartExeWithArgument()
Dim strProgramName As String
Dim strArgument As String
Dim strArgument2 As String
strProgramName = "C:\Program Files (x86)\MacroRecorder\MacroRecorder.exe"
strArgument = "E:\test.mcr"
strArgument2 = " /a"
Call Shell("""" & strProgramName & """ """ & strArgument & strArgument2 & """", vbNormalFocus)
End Sub