Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Baltimore, MD, Maryland, USA
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Halt Execution while User Takes an Action (Office97 Sr2)

    Hi Fellow Loungers:
    A line of my code tests to see if the average of a column of numbers (which an inbedded equation inserts into cell F1) is GT 3 and, if it is, the next line will pop up a message instructing the user to manually refresh a Pivot Table. If the user clicks "OK" in the message box, the code will continue to run. I would like to have the code pause until the Pivot Table has been refreshed (or until the user indicates that he/she has initiated the refresh and that it has occurred). When this has transpired, I would like to go back to the code to perform the test again. If it happens, say, 3 or 4 times, then I want to pop a message saying something like "call me for help" and when the user clicks OK to this, I would like the code to shut down.
    I appreciate the help. For some reason, it is taking me time to feel comfortable with messages and interactions between the user and the code.
    Stephen Stollmack

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Halt Execution while User Takes an Action (Office97 Sr2)

    Stephen,

    If the sole reason for pausing the code is to up refresh thye pivot table, could the code not carry out the refresh. If that is feasible it would be the best solution, otherwise you are into OnTime events and depending on what you are doing it could be very complicated, as there is no pause/resume feature in VBA code.

    Andrew C

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Baltimore, MD, Maryland, USA
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Halt Execution while User Takes an Action (Office97 Sr2)

    Andrew:
    Here is what is happening. This progam runs several queries and pivot table and, for some reason, this one has failed to refresh a couple of times (we only run it once every 2 weeks). So, I inserted code which would check to see of it ran and if it did not run, the user gets a message to click a button which refreshes it again, runs the rest of the sub (in which the refresh is supposed to occur), and then calls the remaining Subroutines.
    Since the fact that it did not run does not stop the program, I guess I simply put the check at the end of the code.
    So, there you have it, I solved my problem again plus I learned that it is difficult to do what I was asking.
    Thank you, again.
    Stephen

Posting Permissions

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