By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,815 Members | 1,151 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,815 IT Pros & Developers. It's quick & easy.

How to turn Excel Delete Warning off

P: n/a
Bob
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(strSourceWorkBook Name)
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

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
Nov 20 '05 #2

P: n/a
* =?Utf-8?B?Qm9i?= <Bo*@discussions.microsoft.com> scripsit:
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(strSourceWorkBook Name)
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
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.