Trouble with Windows 7 Task Scheduler

ryguy7272

Well-Known Member
#1
I used to work with the Windows Task Scheduler every day, a few years ago; haven’t touched it in a while. So, today, I entered the appropriate info for General, Triggers, Actions, Conditions, Settings, and History. I am trying to open an XLSB file, which contains workbook open code in ‘ThisWorkbook’; code here:
Private Sub Workbook_Open()
Call GetFiles
End Sub

So, when I double-click the WB it opens just fine, the event triggers the macro, and everything is lovely. I can’t seem to make this work from the Windows Task Scheduler though. Frustrating. I see Excel open in the Task Manager!! For some reason, unbeknownst to me, WTS is NOT controlling the open event of this XLSB WB. Any ideas? Everything seems correct. I don’t get any error message. It seems like it runs, but it actually doesn’t run.

Thanks everyone!!
 


Mitchell_A

Essential Member
#2
I don't have much experience with the more complex parts of Task Scheduler but my only thought is you may need to add a parameter to the executable in the properties window.
 


ryguy7272

Well-Known Member
#3
Well, the parameter is optional. Also, intuitively, it doesn't make sense to me to do this. I don't even know what kind of parameter I would add.

When the time comes, Task Scheduler opens an instance of Excel, but it will not open the Excel file and thus it will not run my Macro:
Private Sub Workbook_Open()
Call GetFiles
End Sub

Any other thoughts? Anyone?
 


This website is not affiliated, owned, or endorsed by Microsoft Corporation. It is a member of the Microsoft Partner Program.