469,645 Members | 1,595 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

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 3557
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Rajiv | last post: by
14 posts views Thread by pmud | last post: by
18 posts views Thread by Frank M. Walter | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.