+ Reply to Thread
Results 1 to 6 of 6

Pausing macros

  1. #1
    Forum Contributor
    Join Date
    06-05-2006
    Posts
    166

    Pausing macros

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

    Thanks.

  2. #2
    Duncan
    Guest

    Re: 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. #3
    CWillis
    Guest

    Re: 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. #4
    Forum Contributor
    Join Date
    06-05-2006
    Posts
    166
    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

  5. #5
    CWillis
    Guest

    Re: 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. #6
    Duncan
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1