LesterJebson
asked on
Automatically running Microsoft Access macros
I'm looking for some thoughts on a better way to streamline a cumbersome process I have manually running macros in a series of related Microsoft Access databases.
The process begins by opening database 1 and running its macro. As the macro completes, it closes the database. Then I notice at some point that the database has closed. I open database 2, run its macro, it closes. After I notice it closed, I do the same for the next ten databases. The length of time that each macro varies from day to day. Each macro has to wait to begin until the macro in the previous database has completed. The whole manual process can take hours.
One quick method I can think of would be to have each macro save a unique text file on the C drive as it completes. Then have the Task Scheduler run a .bat file periodically that checks if the file exists. If it exists, delete the file and open the next database (after setting the macro to autorun).
This would run the whole series of macros as an automated jobstream. Is there another easy way to do this without having to rewrite the old Microsoft Access processes?
The process begins by opening database 1 and running its macro. As the macro completes, it closes the database. Then I notice at some point that the database has closed. I open database 2, run its macro, it closes. After I notice it closed, I do the same for the next ten databases. The length of time that each macro varies from day to day. Each macro has to wait to begin until the macro in the previous database has completed. The whole manual process can take hours.
One quick method I can think of would be to have each macro save a unique text file on the C drive as it completes. Then have the Task Scheduler run a .bat file periodically that checks if the file exists. If it exists, delete the file and open the next database (after setting the macro to autorun).
This would run the whole series of macros as an automated jobstream. Is there another easy way to do this without having to rewrite the old Microsoft Access processes?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The powershell script would look something like this (assuming all your databases were in the c:\MyDB folder)
Open in new window