I am trying to run a program from excel using shell; however, the program will execute but seems to be failing and closing after the first parameter is passed.
Test code:
In research, I realized there may be an issue passing file paths with spaces so I wrapped all variables with Chr(34) as advised in other threads.
Also of note, if I only execute the program using shell, I can manually enter the other information and the program functions fine.
Test Code:
Any help would be appreciated!
Test code:
VBA Code:
Sub Run_BXLRFDtst()
Dim Dummy As Double
Dim BXLRFD_Input_File_Name As String
Dim BXLRFD_Output_File_Name As String
Dim BXLRFD_Location As String
BXLRFD_Location = "\\files\trans\__Standards-Examples-Templates\DP Design Programs\50\15 PS 3 (LFD)\PS3 v3.6.0.3\PS3.exe"
BXLRFD_Input_File_Name = "C:\Users\arovenolt\Desktop\t\TEST.txt"
BXLRFD_Output_File_Name = "C:\Users\arovenolt\Desktop\t\TEST_IN.OUT"
Dummy = Shell(Chr(34) & BXLRFD_Location & Chr(34) & " " & Chr(34) & BXLRFD_Input_File_Name & Chr(34) & " " & "N" & " " & "N" & " " & Chr(34) & BXLRFD_Output_File_Name & Chr(34), 1)
End Sub
In research, I realized there may be an issue passing file paths with spaces so I wrapped all variables with Chr(34) as advised in other threads.
Also of note, if I only execute the program using shell, I can manually enter the other information and the program functions fine.
Test Code:
VBA Code:
Sub Run_BXLRFDtst()
Dim Dummy As Double
Dim BXLRFD_Input_File_Name As String
Dim BXLRFD_Output_File_Name As String
Dim BXLRFD_Location As String
BXLRFD_Location = "\\files\trans\__Standards-Examples-Templates\DP Design Programs\50\15 PS 3 (LFD)\PS3 v3.6.0.3\PS3.exe"
BXLRFD_Input_File_Name = "C:\Users\arovenolt\Desktop\t\TEST.txt"
BXLRFD_Output_File_Name = "C:\Users\arovenolt\Desktop\t\TEST_IN.OUT"
Dummy = Shell(Chr(34) & BXLRFD_Location & Chr(34) , 1)
End Sub
Any help would be appreciated!