LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 163
Default EXCEL 2003 MACRO Problem

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird Excel 2003 macro problem LindaB789 Excel Discussion (Misc queries) 2 July 30th 09 08:40 PM
2003 to 2007 macro problem Russ Morgan Excel Worksheet Functions 3 January 2nd 09 07:26 PM
Excel 2003 sp3 problem Anthony Excel Discussion (Misc queries) 4 May 6th 08 02:20 PM
Copy and paste problem Excel 2003 to Word 2003 [email protected] Excel Discussion (Misc queries) 2 August 28th 07 11:14 AM
Excel 2003 problem DebbieK Excel Discussion (Misc queries) 0 August 30th 06 10:59 PM


All times are GMT +1. The time now is 04:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"