I have an Excel spreadsheet in which I set up a timer to run code in a database. If the spreadsheet is open, and now the time is the time set in the time interval, then it exports the data to the database
I use this line both in my routine and in workbook_open Application.OnTime TimeValue("22:00:00"), "ExportOpenJobs"
This works great when the spreadsheet is open, but I want to be able to install it through the Windows Schedule task.
I use Windows Server 2012 as my computer and where the file is stored. In Task Scheduler, I set the action to run the program and the script program in the location and actual * .xlsm file along with the start time of the task. I set this task 30 seconds before the time in Excel VBA.
My problem is that the Windows Task Scheduler runs at a set time, after looking at the task history, I see that Task Started / Completed and Action Started / Completed often take about 50 minutes, but when I check the database, Excel VBA did not start.
How can I get my task scheduler to run Excel VBA code?
On Windows Server, you really need to install Excel, so should this be done on another computer?
source
share