Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi!
I wanted to make a short macro, which saves and closes my exce workbook automatically when I haven't done any changes within last 1 mins. The code below shows how to do it, but it also causes som disfunctions. For example the 'Find' command doesn't work while thi code is running. Please give a tip if you know better way to do this or it you know wha changes I should do to this code to make it work properly. Thanks! -AnsiSys -----Cut here------ Dim Changed As Boolean Private Sub Workbook_SheetChange(ByVal Sh As Object, _ ByVal Source As Range) Changed = True End Sub Private Sub Workbook_Open() Changed = False Dim Time1 Dim Time2 Start: Time1 = Timer: Time2 = Timer Do Until Time2 - Time1 600 Or Changed = True DoEvents Time2 = Timer Loop If Changed Then Changed = False: GoTo Start If Me.Saved = False Then Me.Save Me.Close End Sub -----And here----- -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I set up a file to automatically save on exit? | Excel Discussion (Misc queries) | |||
On Exit, always asked to save | Excel Worksheet Functions | |||
Save & Exit | Excel Worksheet Functions | |||
How to Exit Excel Automatically | Excel Programming | |||
save on exit message box | Excel Programming |