Macro help needed

P

Peter

Is there a macro script that will activate "OK" in a
dialog box that otherwise comes up during a macro.

The specific dialog box is in the Fourier Analysis
routine wherein it asks if you want to overwrite existing
data.

Thanks for any help

Peter
 
J

John Wilson

Peter,

That "OK" that comes up is an Alert.
While there's probably an elaborate way to select "OK" via Sendkeys
(not reccomended), the easy way around it is to just disable the Alerts.

Just before the offending line of code where the alert comes up, use:
Application.DisplayAlerts = False
and just after it, use:
Application.DisplayAlerts - True

John
 
P

Peter

John,

Thank you for this suggestion. Unfortunately disabling
the Alerts doesn't seem to work, so I tried
disabling "AlertBeforeOverwriting", which didn't work
either.

Good news though - I tried your SendKeys suggestion -
using Sendkeys "{ENTER}" and this did work!

I am pretty inexperienced at this sort of thing - is
there a particular reason you didn't think this route was
recommendable

regards

Peter
 

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