Microsoft Excel - Scheduler

Asked By Rajender Prasad on 05-Apr-13 08:14 AM
Dear All,

I have scheduled a Macro (WorkBook Open Event) by using Windows Task scheduler, this macro is running successfully but and closing automatically.
But Book1 is getting opened and which is not closing by using VBA code.Because of this, macro is unable to run for next scheduled time. Please help

Regards,
Prasad
Harry Boughen replied to Rajender Prasad on 05-Apr-13 03:55 PM
Hello Rajender,
Try adding
Workbooks("Book1").Close True
to your macro.
If you also want Excel to close down add
Application.Quit
as the last statement.  If you do this you might not even need the first option but you must not close the workbook containing the macro.
Regards
Harry