View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
new1@[no/spam]realce.net new1@[no/spam]realce.net is offline
external usenet poster
 
Posts: 20
Default Time Delayed Response to MsgBox

On 8 avr, 22:28, JT1977 wrote:
I have a several "research" files that I set up to run a macro as soon as a
file is opened. *In each case the macro retrieves and summarizes a bunch of
data taking several minutes to execute. *I'm setting up a "master" file with
a simple macro that will open and close each of the "research" files
sequentially so I can run the series of reports without being at the computer
for hours.

There are times where I want to open a "research" file to review the data
but not execute the macro. *I'd like to add a MsgBox that prompts the user to
by-pass the macro. *However, if I do this when I use the "master" file to
open and run the series of "research" files it will just wait for a response
to the MsgBox before proceeding and thus will once again be dependent on
human intervention.

Is there a way to setup the MsgBox so that if it waits for X amount of time
without receiving a response from the user a default value for the response
will be used which will continue running the macro?


Hello,

I would suggest trying to use the VBA Wait function to measure the X
amount of time, and when the time is expired send a simulated "OK"
key stroke (with VBA SendKeys function ).

Hope this help.

<