ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Insert Photo into a protected worksheet (https://www.excelbanter.com/excel-worksheet-functions/69636-insert-photo-into-protected-worksheet.html)

gnolla

Insert Photo into a protected worksheet
 
How can I allow a user to insert a photo into a particular cell of a
protected worksheet?

Paul B

Insert Photo into a protected worksheet
 
gnolla, how about with a macro?
The first one you can hard code the pic you want, the second one will bring
up the insert picture dialog box and let them pick the one they want

Sub test()
Const PW As String = "123" 'Change Password Here
ActiveSheet.Unprotect Password:=PW
Range("C4").Select
ActiveSheet.Pictures.Insert( _
"C:\My Documents\My Pictures\TestPic").Select
'change pic location and name above
ActiveSheet.Protect Password:=PW
End Sub

Sub test1()
Const PW As String = "123" 'Change Password Here
ActiveSheet.Unprotect Password:=PW
Range("C4").Select
Application.Dialogs(xlDialogInsertPicture).Show
ActiveSheet.Protect Password:=PW
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"gnolla" wrote in message
...
How can I allow a user to insert a photo into a particular cell of a
protected worksheet?





All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com