![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: Kansas
Posts: 5
|
I inherited a number of Excel projects and the previous developer open a workbook and delete all but a few sheets... the Send Keys will often not reach the dialog box in time to accomplish the task. I am looking for a way similar to access to set the warning dialog off and then turning it back on after completion... is there a way?
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Before the sendkeys you can make the macro wait, by using the ontime function.
__________________
Kind regards, Al Chara |
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Location: Kansas
Posts: 5
|
I didn't want to use send keys... too difficult to guarantee success... but FYI I found the "Application.DisplayAlerts = False" is what I needed. Thanks
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
I don't know if you'd be interested, but you don't have to open a worbook to delete sheets from it. This would get rid of the stupid SendKeys command (I have a semi-irrational hatred of that command).
This example will open a workbook in C:Temp called "Book2.xls" it will then delete sheet2 from that workbook, assuming that sheet exists.
I hope this is of use. EDIT:: Obviously there are too many backslashes in the path definition, but you can remove those. That's a known bug of this message board. _________________ [b] Mark O'Brien [ This Message was edited by: Mark O'Brien on 2002-04-05 13:32 ] [ This Message was edited by: Mark O'Brien on 2002-04-05 18:07 ] |
|
|
|
|
|
#5 |
|
New Member
Join Date: Apr 2002
Location: Kansas
Posts: 5
|
Thanks Mark... that should come in very handy.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|