Macro help needed

  • Thread starter Thread starter Peter
  • Start date Start date
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
 
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
 
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
 
Back
Top