Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default VB code still runing

Are you using OnTime for your timer? If so, the settings passed
to OnTime are global to the Excel application, and will only 'go
away' when Excel itself is closed. When the timer pops, Excel
will open the workbook containing the macro specified in OnTime
and execute it.

You should write your code such that the OnTime cancels itself
when the workbook in question is closed.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"DVallier" wrote in message
...
I have VB code timer that shuts down a workbook after awhile.

But if you close it early while any other workbook is open, the
time (and code) still runs. I know this because the workbook
re-opens when the timer runs out - only to close it.
Has anyone run into this?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VB code still runing

Thanks, Chip
I never thought of OnTime being global.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default VB code still runing

I never thought of OnTime being global.

The fact that it is a method of the Application object is a good
indicator that it is global to Excel and not part of an
individual workbook.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Don Vallier" wrote in
message
...
Thanks, Chip.
I never thought of OnTime being global.



Reply
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
table with a runing clock Les Excel Worksheet Functions 2 April 11th 08 05:28 PM
Runing two macros triggered by a button Paul B Excel Discussion (Misc queries) 1 December 9th 05 12:51 AM
Runing two macros triggered by a button Dave Peterson Excel Discussion (Misc queries) 0 December 9th 05 12:43 AM
error after runing MS update last weel 10/13/2005 Quan Excel Discussion (Misc queries) 0 October 17th 05 05:42 PM
Automatically runing a macro Peter Longstaff Excel Programming 4 August 26th 03 09:08 PM


All times are GMT +1. The time now is 06:54 AM.

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

About Us

"It's about Microsoft Excel"