Insert picture into protected sheet

G

Guest

I would like to insert a picture from file into a protected worksheet. At
this point, the Excel pull down menus are greyed out for this feature as long
as the sheet is protected. As far as the user is concered, I want to keep
the sheet protected.

I am looking for a simple solution to allow the insertion of a picture. If
this does not work, I will most likely resort to creating a macro with a
button for picture insertion.

Thanks for the help in advance.
 
G

Guest

You can unprotect it and then protect it again within your code.

ActiveSheet.Protect Password:="fish"

'your code to insert picture, will be something like this but you may also
want to resize or reposition it

ActiveSheet.Pictures.Insert("C:\mypic.jpg")

ActiveSheet.Unprotect Password:="fish"


if screen flickering is a problem, use
application.screenupdating = false before your code AND
application.screenupdating = true after it

HTH
 
G

Guest

Thanks for the quick response. I understand the approach that you are
recommending, but was hoping for a simpler approach. My real question is: Is
it impossible to insert a picture into a protected worksheet? If not, how do
you do it?
 
T

Tom Ogilvy

yes, but . . .

Work around 1.

when you protect the sheet, only protect contents.

Insert the picture to another unprotected sheet, then copy and paste it to
your protected sheet.

work around 2
s = "C:\Documents and Settings\All Users\Documents\My Pictures\Sample
Pictures\Blue Hills.jpg"
ActiveSheet.Protect Password:="ABC", UserInterfaceOnly:=True
ActiveSheet.Pictures.Insert (s)

You only need to set the UserInterfaceOnly property once as long as the
worksheet stays protected. It can only be set with code and it has to be
done whenever the workbook is opened

Work around 3
You received that help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top