Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DS DS is offline
external usenet poster
 
Posts: 117
Default Unable to delete a worksheet in a workbook.

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Unable to delete a worksheet in a workbook.

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
DS DS is offline
external usenet poster
 
Posts: 117
Default My code to delete a worksheet

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default My code to delete a worksheet

Hi Rowan,

I tried "ThisWorkbook.Sheets("Sheet1").Delete". It does not seem to work.

Thanks,

D. Santhosh

"Rowan Drummond" wrote:

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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default My code to delete a worksheet

In what way does it not work? Are you getting an error message? Is the
sheet still there after you run the code? Etc etc?

Regards
Rowan

D Santhosh wrote:
Hi Rowan,

I tried "ThisWorkbook.Sheets("Sheet1").Delete". It does not seem to work.

Thanks,

D. Santhosh

"Rowan Drummond" wrote:


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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2002: Unable to delete Normal_xyz style inherited from workbook(xy Martti Pekkanen Excel Discussion (Misc queries) 1 November 5th 07 08:15 AM
Unable to delete or insert a worksheet. dmarten Excel Discussion (Misc queries) 2 October 31st 06 05:03 PM
in workbook, where is delete worksheet Teressa Excel Worksheet Functions 5 January 19th 06 11:46 PM
Unable to delete Active worksheet DS Excel Programming 0 November 22nd 05 03:00 PM
how do I delete a worksheet from my workbook DLee New Users to Excel 2 August 15th 05 09:59 PM


All times are GMT +1. The time now is 07:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"