I have having task manager call up a VB Script which opens an access document at a certain time everyday, and when this document opens it has VBA Code set up to export the file as a different file type. I am getting an error back that will not allow this to run in task manager. I am really confused, because this should be a really easy task it really is creating a new access program opening the document, and then quitting access. I know that the VBA Code in the access file is correct, because it works OK when the file is opened. Task manager is simple so I know it has to be something with my VB script being incorrect(formatting maybe?), because I double click it to run an I get an run error. I would just set task manager to open the access file, but it will not quit access so we went this way. Below is the code in my script.
dim accessApp as variant
set accessApp = createObject("Access.Application")
accessApp.OpenCurrentDataBase("File Location")
accessApp.Quit
set accessApp = nothing
I did a few searches online already with little luck. Any help is greatly appreciated.
You cannot use a type in your Dim statements with VBScript: