how to send key "press" a key in a dialog?

T

Temoc

While running a macro I have to send the active workbook by email, so the
send mail dialog box opens and awaits for a press button like response.

I want to press the button that says "yes"

How can I "press" the "yes" button by means of a macro instruction?
 
J

Jacob Skaria

Greetings!

You may use the Sendkeys statement
SendKeys "Y", True

There is another option available in VBA to disable such alerts
Application.DisplayAlerts = False

Please try...
 
Top