Automatic accept all pop up dialog box

E

Edmund

While macro is executing. how do I get VBA to automatically select either
"YES†or “OK†whenever any dialog box pops up asking for user input? I just
need VBA to automatically accept any “YES†as well as “OKâ€, which pops up
during execution of macro.

To look through & modify the macro developer’s code will be like impossible.
I’m VBA rookie. Is there a command line which I can insert at the top (after
Dim statement) which can automatically accept all pop ups along execution of
codes?

Thanks alot
 
N

Norman Jones

Hi Edmund,

Try:

Application.DisplayAlerts = False

'Your code

Application.DisplayAlerts = True
 
N

NickHK

Edmund,
I think the answer is basically "No".
But I assume you mean there is code like:

RetVal=MsgBox("Really quit ?", vbYesNo)
If RetVal=vbYes Then...

You could do a search and replace of "RetVal=MsgBox..." for "RetVal=vbYes"

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top