I have very limited experience with writing .bat files. However, I wrote this very simple batch file which executes two Access macros:
Code: Select all
CD \Program Files (x86)\Microsoft Office\Office14
MSACCESS.EXE "C:\...\Databases\final\file.accdb" /X test1
MSACCESS.EXE "C:\...\Databases\final\file.accdb" /X test2
The code executes fine, but requires me to add a "QuitAccess" line to the macros. If I don't, then the first macro will run (test1), but after that nothing will happen. Now in this example there are only 2 macros, but there are cases where I need to run much more macros. In such cases it is very weird to keep shutting down access after the execution of each macro, to be able to run the next one.
Of course I could solve this by creating macros which combine other macros within Access, but I really hope there is a solution to this through programming within the batch file. Of course I already searched the web for a solution, but unfortunately without result. I would be grateful if anyone could direct me to a possible way to solve this issue.
With kind regards