Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 361
Default Is there a way to interrupt "Ontime" macro once it is started?

I have a macro that saves the workbook 30 minutes after opening using
"OnTime". Is there a way to stop this once it has started? I know one way is
to close and reopen the workbook and Excel but is there a way to do it
without having to close the workbook? Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Is there a way to interrupt "Ontime" macro once it is started?

Nope... the best you will do is to pop a mesage for the user warning them of
the save...

if msgbox("Do you wanna save???", vbyesno) = vbyes then thisworkbook.save
--
HTH...

Jim Thomlinson


"Carl" wrote:

I have a macro that saves the workbook 30 minutes after opening using
"OnTime". Is there a way to stop this once it has started? I know one way is
to close and reopen the workbook and Excel but is there a way to do it
without having to close the workbook? Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 361
Default Is there a way to interrupt "Ontime" macro once it is started?

Thanks, Jim. I was afraid this would be the case.

"Jim Thomlinson" wrote:

Nope... the best you will do is to pop a mesage for the user warning them of
the save...

if msgbox("Do you wanna save???", vbyesno) = vbyes then thisworkbook.save
--
HTH...

Jim Thomlinson


"Carl" wrote:

I have a macro that saves the workbook 30 minutes after opening using
"OnTime". Is there a way to stop this once it has started? I know one way is
to close and reopen the workbook and Excel but is there a way to do it
without having to close the workbook? Thanks in advance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Is there a way to interrupt "Ontime" macro once it is started?

If you mean abort a scheduled Ontime before it's occurred, store the
'EarliestTime' and set the optional Schedule to false, eg

Sub myOnTime(bRun As Boolean)
Static tme As Date ' or at module level
If bRun Then
tme = Now + TimeSerial(0, 0, 5) ' 5 sec's from now
End If
Application.OnTime tme, "myMacro", schedule:=bRun

End Sub

Regards,
Peter T


"Carl" wrote in message
...
Thanks, Jim. I was afraid this would be the case.

"Jim Thomlinson" wrote:

Nope... the best you will do is to pop a mesage for the user warning

them of
the save...

if msgbox("Do you wanna save???", vbyesno) = vbyes then

thisworkbook.save
--
HTH...

Jim Thomlinson


"Carl" wrote:

I have a macro that saves the workbook 30 minutes after opening using
"OnTime". Is there a way to stop this once it has started? I know one

way is
to close and reopen the workbook and Excel but is there a way to do it
without having to close the workbook? Thanks in advance.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Is there a way to interrupt "Ontime" macro once it is started?

Well, maybe...
http://www.cpearson.com/excel/ontime.htm
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Carl"

wrote in message
Thanks, Jim. I was afraid this would be the case.


"Jim Thomlinson" wrote:
Nope... the best you will do is to pop a mesage for the user warning them of
the save...
if msgbox("Do you wanna save???", vbyesno) = vbyes then thisworkbook.save
HTH...
Jim Thomlinson





"Carl" wrote:
I have a macro that saves the workbook 30 minutes after opening using
"OnTime". Is there a way to stop this once it has started? I know one way is
to close and reopen the workbook and Excel but is there a way to do it
without having to close the workbook? Thanks in advance.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Is there a way to interrupt "Ontime" macro once it is started?

Chip Pearson has lots of instructions at:
http://www.cpearson.com/excel/ontime.htm

Carl wrote:

I have a macro that saves the workbook 30 minutes after opening using
"OnTime". Is there a way to stop this once it has started? I know one way is
to close and reopen the workbook and Excel but is there a way to do it
without having to close the workbook? Thanks in advance.


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 361
Default Is there a way to interrupt "Ontime" macro once it is started?

Thanks to all for the great information!

"Dave Peterson" wrote:

Chip Pearson has lots of instructions at:
http://www.cpearson.com/excel/ontime.htm

Carl wrote:

I have a macro that saves the workbook 30 minutes after opening using
"OnTime". Is there a way to stop this once it has started? I know one way is
to close and reopen the workbook and Excel but is there a way to do it
without having to close the workbook? Thanks in advance.


--

Dave Peterson

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
Getting "file corrupted" messages, started recently. Evilive138 Excel Discussion (Misc queries) 1 October 15th 08 02:26 PM
cancel the "Getting Started" Dialogue Box when I open XL/Word jazzy1 Setting up and Configuration of Excel 1 May 2nd 08 12:53 AM
how to enter data "OnTime", OR when workbook opened SoupNazi Excel Worksheet Functions 4 April 19th 07 01:24 PM
How to permanently get rid of "Getting Started" task pane in Exce nvizble Excel Discussion (Misc queries) 2 January 28th 06 05:49 AM
Is there any way to set the autofilter of a specified column to "non blank" when the workbook is started? Daniel[_17_] Excel Programming 1 November 2nd 04 08:14 AM


All times are GMT +1. The time now is 03:38 AM.

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"