Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pausing macros


When macros are running is there any way in which you can pause them,
save and resume?

Thanks.


--
phil2006
------------------------------------------------------------------------
phil2006's Profile: http://www.excelforum.com/member.php...o&userid=35092
View this thread: http://www.excelforum.com/showthread...hreadid=556419

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default Pausing macros

I know that the command "Stop" will stop the macro, but then your save
command wont action until you press play again and that presumedly is
not what you want

I think if you ask for a save (activeworkbook.save) then it should save
before continuing. (I think, could be wrong though)

Duncan


phil2006 wrote:

When macros are running is there any way in which you can pause them,
save and resume?

Thanks.


--
phil2006
------------------------------------------------------------------------
phil2006's Profile: http://www.excelforum.com/member.php...o&userid=35092
View this thread: http://www.excelforum.com/showthread...hreadid=556419


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Pausing macros

If you knew ahead of time where you wanted to pause, you could put a break in
the code (F9). I sometimes use a counter. When the counter reaches preset
values, the code pauses. Play or F5 continues the macro from the break point.
-Chris

"phil2006" wrote:


When macros are running is there any way in which you can pause them,
save and resume?

Thanks.


--
phil2006
------------------------------------------------------------------------
phil2006's Profile: http://www.excelforum.com/member.php...o&userid=35092
View this thread: http://www.excelforum.com/showthread...hreadid=556419


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pausing macros


How do you get to the stop button? My problem is that I'm running macros
that iI've estimated will take 10-15 hours at their current rate. I
could do with getting some sort of pause or speeding them up so that I
can leave the computer.

Thanks


--
phil2006
------------------------------------------------------------------------
phil2006's Profile: http://www.excelforum.com/member.php...o&userid=35092
View this thread: http://www.excelforum.com/showthread...hreadid=556419

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Pausing macros

The "run" (play), "break" (pause) and "reset" (Stop) buttons are on the
"standard" toolbar in the VBA window. If you do not see them, right click on
the top toolbar, and go to "customize". Under the "commands" tab, scroll
through the "Categories" until you see "Run". Under "commands" the first
three buttons should be "Run", "Break", and "Reset". Drag and drop each to
your toolbar.

As for speeding up the code, that would depend on the code...

"phil2006" wrote:


How do you get to the stop button? My problem is that I'm running macros
that iI've estimated will take 10-15 hours at their current rate. I
could do with getting some sort of pause or speeding them up so that I
can leave the computer.

Thanks


--
phil2006
------------------------------------------------------------------------
phil2006's Profile: http://www.excelforum.com/member.php...o&userid=35092
View this thread: http://www.excelforum.com/showthread...hreadid=556419




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default Pausing macros

" How do you get to the stop button?"

just putting "Stop" in your code

i.e,
sub Test ()
Msgbox "Hello"
Stop
Msgbox "Goodbye"
End Sub

im not sure how safe it is to use this command, I know not (NOT) to put
it in the before print sub because it brings up a well old error
message and crashes the pc, also this would require your intervention
to continue running the code (press play manually) and you did state
you wanted to leave the pc

there is the command Application.Wait(specify time) and you could put a
line like

Application.Wait( now() + timeserial(0,0,10) )

which if im right (havent tested this) should wait 10 seconds before
commencing.

For speeding up issues, im only a beginner so I will leave this to the
more experianced to answer.

Hope this helps

Duncan


CWillis wrote:

The "run" (play), "break" (pause) and "reset" (Stop) buttons are on the
"standard" toolbar in the VBA window. If you do not see them, right click on
the top toolbar, and go to "customize". Under the "commands" tab, scroll
through the "Categories" until you see "Run". Under "commands" the first
three buttons should be "Run", "Break", and "Reset". Drag and drop each to
your toolbar.

As for speeding up the code, that would depend on the code...

"phil2006" wrote:


How do you get to the stop button? My problem is that I'm running macros
that iI've estimated will take 10-15 hours at their current rate. I
could do with getting some sort of pause or speeding them up so that I
can leave the computer.

Thanks


--
phil2006
------------------------------------------------------------------------
phil2006's Profile: http://www.excelforum.com/member.php...o&userid=35092
View this thread: http://www.excelforum.com/showthread...hreadid=556419



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
Excel pausing BAR Excel Discussion (Misc queries) 0 January 27th 10 09:57 PM
VBA macro pausing [email protected] Excel Worksheet Functions 2 February 23rd 09 01:19 PM
Pausing a Macro PaulW Excel Discussion (Misc queries) 0 May 30th 06 02:05 PM
pausing vba for refresh westg Excel Programming 5 August 17th 05 09:38 PM
pausing a macro Hasan Cansü[_2_] Excel Programming 6 February 27th 04 06:40 PM


All times are GMT +1. The time now is 08:44 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"