Executing multiple macros without quitting the application

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Fantast
Posts: 2
Joined: 17 Jul 2012 07:58

Executing multiple macros without quitting the application

#1 Post by Fantast » 17 Jul 2012 08:12

Hello all.

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

C:
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
pause
CD \
EXIT

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
Fantast~

Squashman
Expert
Posts: 3741
Joined: 23 Dec 2011 13:59

Re: Executing multiple macros without quitting the applicati

#2 Post by Squashman » 17 Jul 2012 14:49

I would say your best bet is to create a macro that calls the other macros.

Fantast
Posts: 2
Joined: 17 Jul 2012 07:58

Re: Executing multiple macros without quitting the applicati

#3 Post by Fantast » 18 Jul 2012 02:28

@Squashman
That is unfortunate. I guess I have no other option at the moment indeed. Thank you for your input.

Post Reply