PC Review


Reply
Thread Tools Rate Thread

code reopens file

 
 
=?Utf-8?B?QUpC?=
Guest
Posts: n/a
 
      13th Sep 2007
The following code tries to reopen my files 30-45 seconds after I close them.
Any ideas what might make it do this? The code is meant to track my time in
the different bids I work on

Thanks,

Andy

Code in module:
Public Sub StartCounting(Optional bStart As Boolean = False)
Const dINCREMENT As Date = #12:01:00 AM#
If Not bStart Then
With Sheets("Bid Summary").Range("J3")
..Value = .Value + dINCREMENT
End With
End If
dNextCall = Now + dINCREMENT
Application.OnTime dNextCall, "StartCounting", Schedule:=True
End Sub

Public Sub StopCounting()
Application.OnTime dNextCall, "StartCounting", Schedule:=False
End Sub

Code in workbook:
Public Sub StartCounting(Optional bStart As Boolean = False)
Const dINCREMENT As Date = #12:01:00 AM#
If Not bStart Then
With Sheets("Bid Summary").Range("J3")
..Value = .Value + dINCREMENT
End With
End If
dNextCall = Now + dINCREMENT
Application.OnTime dNextCall, "StartCounting", Schedule:=True
End Sub

Public Sub StopCounting()
Application.OnTime dNextCall, "StartCounting", Schedule:=False
End Sub
 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      13th Sep 2007
Unless you are closing Excel you have to call the StopCounting routine
before you close the workbook, else Excel looks for the macro you scheduled.

--
Jim
"AJB" <(E-Mail Removed)> wrote in message
news:1A7536F9-9AAB-4141-A744-(E-Mail Removed)...
| The following code tries to reopen my files 30-45 seconds after I close
them.
| Any ideas what might make it do this? The code is meant to track my time
in
| the different bids I work on
|
| Thanks,
|
| Andy
|
| Code in module:
| Public Sub StartCounting(Optional bStart As Boolean = False)
| Const dINCREMENT As Date = #12:01:00 AM#
| If Not bStart Then
| With Sheets("Bid Summary").Range("J3")
| .Value = .Value + dINCREMENT
| End With
| End If
| dNextCall = Now + dINCREMENT
| Application.OnTime dNextCall, "StartCounting", Schedule:=True
| End Sub
|
| Public Sub StopCounting()
| Application.OnTime dNextCall, "StartCounting", Schedule:=False
| End Sub
|
| Code in workbook:
| Public Sub StartCounting(Optional bStart As Boolean = False)
| Const dINCREMENT As Date = #12:01:00 AM#
| If Not bStart Then
| With Sheets("Bid Summary").Range("J3")
| .Value = .Value + dINCREMENT
| End With
| End If
| dNextCall = Now + dINCREMENT
| Application.OnTime dNextCall, "StartCounting", Schedule:=True
| End Sub
|
| Public Sub StopCounting()
| Application.OnTime dNextCall, "StartCounting", Schedule:=False
| End Sub


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reopens file on first click Pungh0Li0 Microsoft Excel Discussion 0 15th Mar 2008 01:50 AM
Workbook reopens after close John Michl Microsoft Excel Programming 2 13th Dec 2006 10:49 PM
SIP not closing, reopens after app closes Jeremy Microsoft Dot NET Compact Framework 1 18th Oct 2006 01:32 AM
Saved word file reopens as a series of squares and symbols. Why? =?Utf-8?B?UGF1bCBIb2xtZXM=?= Microsoft Word Document Management 6 18th May 2006 04:07 AM
XP Pro does not shut down but reopens =?Utf-8?B?am9obm5t?= Windows XP General 2 28th Dec 2004 11:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:20 AM.