Hi, I'm trying to create a batch file to automatically open an excel workbook and run the macro so the user doesn't have to baby-sit the process. In my module, I'm using the Auto_open sub to call the rest of the macro. However, there are times where I or the user want to open up the workbook manually, and those times we don't want to the macro to start running automatically. To distinguish between the two purposes, I want to read the command-line arguments and if a particular argument exists, then continue running the macro automatically; and if not, then exit the Auto_open sub.
I can't seem to figure out how to read the command line arguments. I'm using Excel 2000, and I tried using both the GetCommandLineA function in the library Kernel32 - the example code is found here: http://j-walk.com/ss/excel/eee/eee002.txt under the "Power Programming Technique" section. I also tried using the Command() function, but even the help mentions how this function doesn't work in MS Office.
Is there a way I can check for the existence of command line args, and if they exist, get them so I can parse them and check for a specific type of arg? Thanks for the help.
I can't seem to figure out how to read the command line arguments. I'm using Excel 2000, and I tried using both the GetCommandLineA function in the library Kernel32 - the example code is found here: http://j-walk.com/ss/excel/eee/eee002.txt under the "Power Programming Technique" section. I also tried using the Command() function, but even the help mentions how this function doesn't work in MS Office.
Is there a way I can check for the existence of command line args, and if they exist, get them so I can parse them and check for a specific type of arg? Thanks for the help.