473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to turn Excel Delete Warning off

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
2 3324
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
* =?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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dan | last post by:
Hello, I am trying to read and write to an Excel file via my Java applet. I have done so successfully on several simple Excel files that simply had data cells without many complicated equations...
13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
4
by: Rich Wallace | last post by:
Is there a way to open an Excel file and either respond to or supress the Macro warning window via VB.NET? Dim oExcel As Excel.Workbook Dim sFilePath As String = "C:\DailyReport.xls" oExcel...
8
by: Sam | last post by:
Hi All, I posted this message few days ago. No one has answered so far. I just would like to know if it is possible to do or not. Even if you can not tell me how to do this, maybe you know which...
3
by: Rene | last post by:
Hi Proggies, i try to delete an excel worksheet but nothing happens (work on vb.net 2005) ..... xlSheet = xlApp.Sheets("Master") xlSheet.select xlSheet.delete also try
7
by: Eran.Yasso | last post by:
Hi, I have project that automate excel(using Excel COM) which works fine in my home. I took the project from my home to work and tried to build the project but it won't built. I get error "The...
3
by: colmkav | last post by:
Anyone know how to do the equivalent in Access VBA to: Application.DisplayAlerts = false (as you do in VBA Excel) For some reason after I do compact on my db Access starts displaying all the...
3
LacrosseB0ss
by: LacrosseB0ss | last post by:
Quick question: is there a way to programmatically turn off the warning message for macros in Excel? (Macros can be harmful ... enable/disable) The reason for the question is on our intranet page...
0
by: jwmaiden | last post by:
Have an application that opens up a webbrowser control to display data in an Excel spreadsheet (using VB.NET in VS 2005). No problem with opening the spreadsheet or displaying the data, but I'm...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.