Insert pictures

A

AZU

I've protected my worksheet (an incident report form), but left some cells
unlocked so as the user can enter information. I can enter text, but cannot
enter (insert) a picture from file (for incident photos). I can enter the
photos when the whole sheet is unprotected, but that would leave other cells
and information vunrable to being changed.

signed,
Overly Confused
 
S

Shane Devenshire

Hi,

when you protect the sheet, check the Edit objects option in the dialog box.
 
A

AZU

No, sorry it never worked. I click on "Insert"->Picture-> (but everything
here is grayed out). I'll keep trying other options, but I'm running out of
ideas.
 
G

Gord Dibben

1. You can't insert a picture into a cell so it doesn't matter if cells are
locked or unlocked.

2. You will have to use a macro that unprotects, inserts the picture then
re-protects.

Something like this.................

Sub insert_pic()
ActiveSheet.Unprotect
filetoopen = Application _
.GetOpenFilename("pictures (*.jpg), *.jpg")
'browse to a folder and double-click on desired *.jpg
If filetoopen <> False Then
ActiveSheet.Pictures.Insert (filetoopen)
End If
ActiveSheet.Protect DrawingObjects:=False
'DrawingObjects:=False allows editing the inserted picture
End Sub



Gord Dibben MS Excel MVP
 
G

Gord Dibben

If you want a password on the protection use these lines instead.

Sub insert_pic()
ActiveSheet.Unprotect Password:="justme"ActiveSheet.Protect Password:="justme", DrawingObjects:=False
End Sub

Then you could lock the project from viewing to prevent snoopers from seeing
the code and the sheet protection password.

Alt F11 to open VBE

Right-click on your project ans select VBAProject Properties>Protection

Selected locked for viewing and enter a password.

Save the file to enable the locking.


Gord
 
A

AZU

Thanks, I'll try that. I'm not good at VB, but I'll try and muddle through
it. Trial & Error.....
 

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