set workbook close...

asyamonique

Well-known Member
Joined
Jan 29, 2008
Messages
1,286
Office Version
  1. 2013
Platform
  1. Windows
Code:
Sub close_me()
ThisWorkbook.Close Savechanges:=True
End Sub
 
Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:10:00"), "close_Me"
End Sub

Good Day,
Currently i have the given code above for to close workbook itself within 10min.
Is it possible to set a timer from 10 sec. to countdown before closing the file?
Many Thanks,
 
Last edited:

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Code:
Sub close_me()
ThisWorkbook.Close Savechanges:=True
End Sub


Sub close1_me()
MsgBox "10 Sec before Workbook closes"
Application.OnTime Now + TimeValue("00:00:10"), "close_Me"
End Sub

 
Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:09:50"), "close1_Me"
End Sub

would this help!!!!
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,818
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top