+ Reply to Thread
Results 1 to 2 of 2

Protect Only an Object on a Worksheet

  1. #1
    Reed Markley
    Guest

    Protect Only an Object on a Worksheet

    Hi All:
    In Excel XP (2002), how do I protect only a pushbutton object, so users
    won't reformat or delete it. I want to leave the rest of the sheet
    completely unprotected, since I am using a VBA form to modify and add data
    to the worksheet. The button launches the form. I have set all the cells on
    the sheet to be unlocked by selecting all the cells on the sheet and
    unchecking the checkbox in the format cells dialog. I then go to
    Tools-Protection-Protect Sheet and check all the checkboxes except the ones
    to allow users to edit objects and scenarios and to select locked cells. I
    check the Protect worksheet and contents of locked cells checkbox and hit
    OK. Theoretically, only objects should be protected. There are no scenarios
    or locked cells on the sheet. The object (button) is indeed protected. I
    then push the button to launch the data entry form and get the following VBA
    message. Run-time error '1004': Delete method of Range class failed. Te code
    behind the form does indeed delete a cell at the start. The form does not
    appear. If I select debug on the error message I am taken to the code
    performing the delete operation.

    What am I doing wrong. I had no trouble getting this technique to function
    properly in Excel 2000.

    --
    Best Regards
    Reed W. Markley
    Kahiltna Software



  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481
    I
    then push the button to launch the data entry form and get the following VBA
    message. Run-time error '1004': Delete method of Range class failed. Te code
    behind the form does indeed delete a cell at the start. The form does not
    appear. If I select debug on the error message I am taken to the code
    performing the delete operation.

    When you message comes up, have you pressed help to see what was up?
    Does the message come up only when there is nothing to delete?

    Just wondering, need more info,
    I have had macros that searched for a word and delete the row, if it couldn't find the word I would get an error, so ended needing some extra code like
    on error exit sub

+ 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