ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to send key "press" a key in a dialog? (https://www.excelbanter.com/excel-programming/425018-how-send-key-press-key-dialog.html)

Temoc

how to send key "press" a key in a dialog?
 
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?

Jacob Skaria

how to send key "press" a key in a dialog?
 
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...




"Temoc" wrote:

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?



All times are GMT +1. The time now is 09:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com