I have a Excel spreadsheet which I've set up a timer to run code into a database. If the spreadsheet is open and the time now is the time set within the timeslot then it exports the data into the database
I use this line in both my subroutine and the workbook_open Application.OnTime TimeValue("22:00:00"), "ExportOpenJobs"
This is great for when the spreadsheet is open, but I want to be able to set it through the Windows Schedule task.
I'm using Windows Server 2012 as my host pc and where the file is stored. Within the Task Scheduler I set the Action to Start a program and the Program script to the location and the actual *.xlsm file along with the start time for the Task. I set this task 30seconds before the time within the Excel VBA.
My problem is that the Windows Task Scheduler runs at the time set, after looking at the Task History I can see the Task Started/Completed and Action Started/Completed often taking around 50mins to complete, but when I check the database the Excel VBA hasn't run.
How can I get my Task Scheduler to run the Excel VBA code?
Within the Windows Server do you actually need to have Excel installed, therefore should it be done on another machine?