472,364 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

delete sheet in excel

Bas
I',m trying to delete a named worksheet - what's wrong with this??
xlApp = New Excel.Application()
Dim xWorkbook As Excel.Workbook
Dim PageSht As Excel.Worksheet
xWorkbook = xlApp.Workbooks.Open("Test.xls")
Dim pageWkSht As Excel.Worksheet
pageSht = xWorkbook.Sheets("Page")
pageSht.Delete()

No error is generated and the sheet is NOT deleted

Nov 21 '05 #1
2 3631
Hi,

Bas wrote:
I',m trying to delete a named worksheet - what's wrong with this??
xlApp = New Excel.Application()
Dim xWorkbook As Excel.Workbook
Dim PageSht As Excel.Worksheet
xWorkbook = xlApp.Workbooks.Open("Test.xls")
Dim pageWkSht As Excel.Worksheet
pageSht = xWorkbook.Sheets("Page")
pageSht.Delete()

No error is generated and the sheet is NOT deleted


have you tried ..
xWorkbook.Sheets("Page").Delete()
...?

Cheers,
Olaf
Nov 21 '05 #2
xWorkbook.Sheets("Page"). only give "GetType" in intelisense

"Olaf Rabbachin" <Ol*********@IntuiDev.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

Bas wrote:
I',m trying to delete a named worksheet - what's wrong with this??
xlApp = New Excel.Application()
Dim xWorkbook As Excel.Workbook
Dim PageSht As Excel.Worksheet
xWorkbook = xlApp.Workbooks.Open("Test.xls")
Dim pageWkSht As Excel.Worksheet
pageSht = xWorkbook.Sheets("Page")
pageSht.Delete()

No error is generated and the sheet is NOT deleted


have you tried ..
xWorkbook.Sheets("Page").Delete()
..?

Cheers,
Olaf

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Rajiv | last post by:
HI ALL, actually , i m working in a company having large number of employee , i have two userid and password . on id is from admin group(id given to me by technology manager) of the server and...
1
by: smonczka | last post by:
I have a DTS package that needs to refresh data in 3 separate Excel spreadsheets on a daily basis. The problem is that unless I manually delete the previous day's data, it appends rather than...
1
by: Vivek | last post by:
Hi all, I am trying to import data from an excel sheet to MSSQL server 2000 using a web application (C#). Since I have to validate the data in the excel sheet, the approach i have used is to get...
14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
1
by: richilli | last post by:
Hi Any help on this would be appreciated cos its driving me insane. I have a function in VB.NET that takes in an excel range and tries to delete rows where the first column starts with a...
3
by: | last post by:
I wrote a class in VB.NET to export the contents of a datagrid to Excel. It works perfectly on my machine, but it fails on my customers' PCs that have identical versions of Win XP (SP1) and Excel...
18
by: Frank M. Walter | last post by:
Hello, I have made an small AddIn with udf for excel 2003. I use vs2003. The point of view is the function __T() I call it in excel sheet writing =__T() I am not able to set a value to a...
4
by: B.N.Prabhu | last post by:
How to delete first row from an Excel Sheet using C#.Net. Please Help. Its very urgent.
7
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...

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.