Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi all gurus please help.
I have a windows schelduler to open at a certain time and when the cells have been updated the file closes. The problems i'm having it the file stays open and i have to manually close the open file on a weekly basis, the cells are not updated either? Please see my code below: Private Changed As Boolean Private Sub Workbook_Open() 'start with the workbook showing unchanged Changed = False ' create our shutdown timer Application.OnTime Now + TimeValue("00:00:10"), procedu="ThisWorkbook.Auto_Close" End Sub Private Sub Workbook_SheetChange(ByVal Sh As Object, _ ByVal Source As Range) 'if something is changed then restart the timer Changed = True End Sub Private Sub Auto_Close() 'if no changes detected then save and close If Changed = False Then ThisWorkbook.Close SaveChanges:=True End If Changed = False 'cancel the timer Call Application.OnTime(Now + TimeValue("00:00:15"), "ThisWorkbook.Auto_Close") End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Weird Excel 2003 macro problem | Excel Discussion (Misc queries) | |||
2003 to 2007 macro problem | Excel Worksheet Functions | |||
Excel 2003 sp3 problem | Excel Discussion (Misc queries) | |||
Copy and paste problem Excel 2003 to Word 2003 | Excel Discussion (Misc queries) | |||
Excel 2003 problem | Excel Discussion (Misc queries) |