G
Guest
I am trying to run a .bat file from Excel. The Shell command works fine as long as there are no spaces in the path. So, for instance, running
C:\Apps\BFile.bat
works ok. But
C:\My Apps\BFile.bat
does not. The macro runs without an error, but the .bat file is simply not run.
Ideally, I would like to enter the path and file in a cell, and then click a button to run a macro to run the batch file. This means using double quotations
i = Shell (""C:\My Apps\BFile.bat"", 1)
would not be appropriate, as I am trying to use
Bat_File = Range("A2").Value
i = Shell (Bat_File, 1)
Anyone help?
C:\Apps\BFile.bat
works ok. But
C:\My Apps\BFile.bat
does not. The macro runs without an error, but the .bat file is simply not run.
Ideally, I would like to enter the path and file in a cell, and then click a button to run a macro to run the batch file. This means using double quotations
i = Shell (""C:\My Apps\BFile.bat"", 1)
would not be appropriate, as I am trying to use
Bat_File = Range("A2").Value
i = Shell (Bat_File, 1)
Anyone help?