uzi_mon85
01-27-2015, 01:43 PM
Hi Community,
I am trying to automate my excel workbook to save and close by itself after being opened for 2 minutes.
the openning part i am handling via windows task scheduler,
however the saving and closing part I am trying to do via VBA with no luck so far. Here is the code, if one of you experts can please look at it to help me out, it will be greatly appreciated.'
Thanks,
Public Sub Workbook_Open() Application.OnTime Now + TimeValue("00:02:00"), "ThisWorkbook.TimeOutSaveAndClose"
End Sub
Public Sub TimeOutSaveAndClose()
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.Quit
End Sub
I am trying to automate my excel workbook to save and close by itself after being opened for 2 minutes.
the openning part i am handling via windows task scheduler,
however the saving and closing part I am trying to do via VBA with no luck so far. Here is the code, if one of you experts can please look at it to help me out, it will be greatly appreciated.'
Thanks,
Public Sub Workbook_Open() Application.OnTime Now + TimeValue("00:02:00"), "ThisWorkbook.TimeOutSaveAndClose"
End Sub
Public Sub TimeOutSaveAndClose()
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.Quit
End Sub