View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rowan Drummond[_3_] Rowan Drummond[_3_] is offline
external usenet poster
 
Posts: 414
Default My code to delete a worksheet

Try

ThisWorkbook.Sheets("Sheet1").Delete

Hope this helps
Rowan

DS wrote:
Hi Dales,

Below is my code to delete "Sheet1" worksheet in my workbook.

With DirectCast(ThisWorkBook.Sheets("Sheet1"), Excel.Worksheet)
.Select()
.Delete()
End With

Thanks
D. Santhosh

"K Dales" wrote:


Nothing happens = not even an error message?

Would need to see code to figure it out.
--
- K Dales


"DS" wrote:


I try to delete a worksheet in a workbook using .Delete() method of the
worksheet object. When I run the program nothing happens.

Can any one point to me how to delete a worksheet in a workbook using Excel
object?

Please see below for my working environment.

Platform:
.NET 1.1 program references MS Excel 11 library.
MS Office 2003.

Thanks
D. Santhosh