+ Reply to Thread
Results 1 to 6 of 6

Unable to delete a worksheet in a workbook.

  1. #1
    DS
    Guest

    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. #2
    K Dales
    Guest

    RE: 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. #3
    DS
    Guest

    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. #4
    Rowan Drummond
    Guest

    Re: 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. #5
    D Santhosh
    Guest

    Re: 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. #6
    Rowan Drummond
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1