Closed Thread
Results 1 to 11 of 11

Prevent Sheet Deletion

Hybrid View

  1. #1
    Dave Peterson
    Guest

    Re: Prevent Sheet Deletion

    Norman's code will stop users from deleting the sheet if the user doesn't
    disable macros (and activates that sheet at least once) by stopping the menu
    commands.

    But I could still choose to move it to a new workbook--or even use code to
    delete that sheet.

    Just something to be aware of.

    On the other hand, workbook protection is easily broken, too.

    "T-容x" wrote:
    >
    > Hi!
    >
    > Is it possible to prevent a particular sheet from being deleted?
    >
    > I have a workbook that contains sheets (of course). One of the sheets
    > serves as a "Help" sheet. I don't want users to accidentally (or
    > intentionally)
    > delete just this sheet.
    >
    > --
    > T-容x
    > ------------------------------------------------------------------------
    > T-容x's Profile: http://www.excelforum.com/member.php...o&userid=26572
    > View this thread: http://www.excelforum.com/showthread...hreadid=401664


    --

    Dave Peterson

  2. #2
    Dave Peterson
    Guest

    Re: Prevent Sheet Deletion

    And if you have multiple workbooks open and go from the Help sheet to a
    different workbook, then the worksheet_deactivate event won't fire.

    You may want to add Workbook_Activate and Workbook_Deactivate code, too.

    (I like the workbook protection suggestion more and more <vbg>.)

    Dave Peterson wrote:
    >
    > Norman's code will stop users from deleting the sheet if the user doesn't
    > disable macros (and activates that sheet at least once) by stopping the menu
    > commands.
    >
    > But I could still choose to move it to a new workbook--or even use code to
    > delete that sheet.
    >
    > Just something to be aware of.
    >
    > On the other hand, workbook protection is easily broken, too.
    >
    > "T-容x" wrote:
    > >
    > > Hi!
    > >
    > > Is it possible to prevent a particular sheet from being deleted?
    > >
    > > I have a workbook that contains sheets (of course). One of the sheets
    > > serves as a "Help" sheet. I don't want users to accidentally (or
    > > intentionally)
    > > delete just this sheet.
    > >
    > > --
    > > T-容x
    > > ------------------------------------------------------------------------
    > > T-容x's Profile: http://www.excelforum.com/member.php...o&userid=26572
    > > View this thread: http://www.excelforum.com/showthread...hreadid=401664

    >
    > --
    >
    > Dave Peterson


    --

    Dave Peterson

  3. #3
    Registered User
    Join Date
    08-24-2005
    Location
    Philippines
    Posts
    75

    Talking Thanks!!!

    Thanks guys for all your suggestions!!!
    I can't protect the workbook as I must allow users to add/delete sheets (and do other stuffs not available in a protected workbook).
    Norman Jones, I'll give your code a try. Thanks.

  4. #4
    Registered User
    Join Date
    12-20-2008
    Location
    Mumbai
    MS-Off Ver
    Microsoft Office 2003 and 2007
    Posts
    36

    Re: Prevent Sheet Deletion

    I used the above code to share an excel file named "Query" on a Local Area Network".
    Now my job is done.
    But now I am not able to delete any sheet even when I disable macros.
    I cannot even delete any sheet from a new workbook.
    I have erased the code but still I get the following error message "Query.xls not found"
    Please help!!!!!!!!!!

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Prevent Sheet Deletion

    Please don't post in 4-year old threads; start your own.

    See Help for Features that are unavailable in shared workbooks.
    Entia non sunt multiplicanda sine necessitate

Closed 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