scurvylion
asked on
Using VB script to run Access macro at specific time
Hi,
This is part of a project that I am doing. I am at the stage where I have successfully automated the import of .csv files into an Access database (with lots of help from EE). Now I want to automate the process so that every night at say 2:00 AM a VB script runs and opens the Access 2007 database and runs a macro (which calls the VBA code to update the database) and then closes.
I believe that this should be pretty easy to operationalize but I have no experience working with VB scripts at all so any help that I can get would be most appreciated.
Thanks,
scurvylion
This is part of a project that I am doing. I am at the stage where I have successfully automated the import of .csv files into an Access database (with lots of help from EE). Now I want to automate the process so that every night at say 2:00 AM a VB script runs and opens the Access 2007 database and runs a macro (which calls the VBA code to update the database) and then closes.
I believe that this should be pretty easy to operationalize but I have no experience working with VB scripts at all so any help that I can get would be most appreciated.
Thanks,
scurvylion
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if your vba codes does not include to close the application
docmd.quit ' you can add this at the end of the vba code
or
in the macro
action
runcode
quit 'add this
docmd.quit ' you can add this at the end of the vba code
or
in the macro
action
runcode
quit 'add this
ASKER
Works great! Thanks for your help - appreciate it very much!
ASKER
Thanks!!
ASKER
It ran great but the database didn't close and the svchost.exe continued to run. is there another command that I need in this script file or is the error in my VBA code in the macro?
scurvylion