Private Sub Workbook_Open()
Application.OnTime TimeValue("19:00:00"), "close_me"
End Sub
Sub close_me()
ThisWorkbook.Close Savechanges:=True
End Sub
Hi,
You can use the OnTime method for this.
Pop this on your ThisWorkbook page in the workbook's VBA project:
Code:Private Sub Workbook_Open() Application.OnTime TimeValue("19:00:00"), "close_me" End Sub
And then this in a standard module in the project:
Code:Sub close_me() ThisWorkbook.Close Savechanges:=True End Sub
It will close the workbook at 19:00 and save any changes.
Dom