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

delete sheet in excel

P: n/a
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
Share this Question
Share on Google+
2 Replies

P: n/a
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

P: n/a
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.