ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SendKeys Positioning (https://www.excelbanter.com/excel-programming/367202-sendkeys-positioning.html)

ajvasel

SendKeys Positioning
 
I am trying to make a program that I have created as user-friendly as
possible. During the program, I delete 2 worksheets to leave only 1
worksheet. I tried using a SendKeys statement to click through the
confirmation pop-up message, but I think that I may be placing the statement
in the wrong area.

Here is the statement I used:

Application.SendKeys ("{Enter}")

Where should I place this in the program, or is there a way to delete sheets
without a pop-up message displaying? Thx

Chip Pearson

SendKeys Positioning
 
Don't use SendKeys. Instead, turn off DisplayAlerts. E.g.,

Application.DisplayAlerts = False
' delete the sheet
Application.DisplayAlerts = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"ajvasel" wrote in message
...
I am trying to make a program that I have created as
user-friendly as
possible. During the program, I delete 2 worksheets to leave
only 1
worksheet. I tried using a SendKeys statement to click through
the
confirmation pop-up message, but I think that I may be placing
the statement
in the wrong area.

Here is the statement I used:

Application.SendKeys ("{Enter}")

Where should I place this in the program, or is there a way to
delete sheets
without a pop-up message displaying? Thx




ajvasel

SendKeys Positioning
 
Thanks Chip - 'preciate the help

"Chip Pearson" wrote:

Don't use SendKeys. Instead, turn off DisplayAlerts. E.g.,

Application.DisplayAlerts = False
' delete the sheet
Application.DisplayAlerts = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"ajvasel" wrote in message
...
I am trying to make a program that I have created as
user-friendly as
possible. During the program, I delete 2 worksheets to leave
only 1
worksheet. I tried using a SendKeys statement to click through
the
confirmation pop-up message, but I think that I may be placing
the statement
in the wrong area.

Here is the statement I used:

Application.SendKeys ("{Enter}")

Where should I place this in the program, or is there a way to
delete sheets
without a pop-up message displaying? Thx






All times are GMT +1. The time now is 02:12 PM.

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