Run .bat file from Excel VBA
I simply want to run a .bat file in DOS when I open an Excel file.
My .bat file collects all the .txt file names in a specific directory and stores file names that start with "HC" in one .txt file and file names that start with "HR" in another:
cd c:\My Files\Junk
dir HC*.txt /b > Catfiles.txt
dir HR*.txt /b > Retfiles.txt
Afterwards, my Excel macro reads each of these files (Catfiles.txt and Retfiles.txt), gets the file names, and opens them one at a time.
Currently, I run the .bat file before I open the Excel file. I WOULD LIKE to launch the .bat file when I open my Excel file with some sort of "On Open" command.
Thank you. Harold Hawken
|