Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete an excel sheet from vb app??

Status
Not open for further replies.

Bastien

Programmer
May 29, 2000
1,683
0
0
CA
I can delete the sheet with VB code but the excel app asks for confirmation...can I get around this confirmation? Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 

I believe intellisense should show you options and setting the correct option should turn off the confirmation message.
 
Hi Bastien,

Yes. Try this:

Dim ExcelApp As New Excel.Application

' ...
' disable warnings
ExcelApp.DisplayAlerts = False
' ... do something
' enable warnings
ExcelApp.DisplayAlerts = True

Bye
LauDse
 
As LauDse says put your delete code between the code to turn off the alerts. Be careful using this as it very easy to turn off the warnings and not renable them. Try to ensure only the code which can open a dialogue box is inside the disable code, if not this can cause all sorts of weird behavior with in Excel. This is also applicable with Access.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top