tags:

views:

2098

answers:

2

I have an Excel worksheet with an image (logo). If I right-click on the picture and select Format Picture / Protection, the "Locked" checkbox is checked. I then protect the worksheet with a password.

Despite all of the above, the end user can still select and delete the image. Is there any way to prevent this?

Update

Indeed Edit Objects was unchecked.

The Worksheet.Protect method I am using has a number of optional parameters which control what the user can modify on a protected sheet. The majority of these are parameters named AllowXXX (e.g. AllowFormattingColumns) which default to False.

The parameter DrawingObjects is an exception. This parameter defaults to False: to protect drawing objects it must be explicitly set to True.

A: 

Try protecting the WorkBOOK also.

Edit: Ugh -- that doesn't seem to work.

I Googled up this very ugly solution: prevent an image from being deleted or replaced

TrickyNixon
+1  A: 

Protecting the sheet works for me.

Check that the option "Edit objects" (down the bottom of the list of things you can allow the user to do, in the protection dialog box) is NOT checked.

dbb