How to turn Excel Delete Warning off

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In the following code, when the DELETE line is executed I get a dialog asking if I want to delete or to cancel. How do I turn it off? Also when the first CLOSE line is executed, the application so to sleep.

Dim strTabName = Path.GetFileNameWithoutExtension(strSourceWorkBookName)
Dim wbSOURCE As Excel.Workbook
Dim wbTARGET As Excel.Workbook

With appExcel
wbSOURCE = .Workbooks.Open(strSourceWorkBookName)
wbTARGET = .Workbooks.Open(strTargetWorkBookName)
wbTARGET.Sheets(strTabName).select()
wbTARGET.ActiveSheet.delete()
wbTARGET.Close(True)
wbSOURCE.Close()
.Quit()
End With
 
Bob,

This is using Office programming in a Net wrapper. It is interopp. For this
kind of questions you get probably a better or more answers in a real office
developer newsgroup..

microsoft.public.office.developer*

There are a lot.

I hope this helps?

Cor
 
* =?Utf-8?B?Qm9i?= said:
In the following code, when the DELETE line is executed I get a dialog
asking if I want to delete or to cancel. How do I turn it off? Also
when the first CLOSE line is executed, the application so to sleep.
Dim strTabName = Path.GetFileNameWithoutExtension(strSourceWorkBookName)
Dim wbSOURCE As Excel.Workbook
Dim wbTARGET As Excel.Workbook

With appExcel
wbSOURCE = .Workbooks.Open(strSourceWorkBookName)
wbTARGET = .Workbooks.Open(strTargetWorkBookName)
wbTARGET.Sheets(strTabName).select()
wbTARGET.ActiveSheet.delete()
wbTARGET.Close(True)
wbSOURCE.Close()
.Quit()
End With

\\\
With Application
.DisplayAlerts = False
ThisWorkbook.SaveAs("D:\file.xls")
.DisplayAlerts = True
End With
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top