Paste Image into Protected Sheet

Jason8598

New Member
Joined
Jun 17, 2011
Messages
10
I have a protected sheet that I would like to be able to paste an image to and resize as needed. There are also several command buttons in the same sheet that I want to remain protected. I know that I can allow editing of objects when I go to protect the sheet, but this will allow someone to edit the command buttons, which I do not want. Is there a way that will allow pasting and resizing of an image and still keep the buttons protected?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
You can do that in code like this

Code:
Sub piccy()
ActiveSheet.Unprotect Password:="abc"
ActiveSheet.Pictures.Insert ("C:\example\pic.jpg")
With ActiveSheet.Shapes(ActiveSheet.Shapes.Count)
    .LockAspectRatio = False
    .Top = Range("C3").Top
    .Left = Range("C3").Left
    .Height = Range("C3").RowHeight
    .Width = Range("C3").Width
End With
ActiveSheet.Protect Password:="abc"
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,866
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top