ryan_law2000
Well-known Member
- Joined
- Oct 2, 2007
- Messages
- 738
Can anyone help with this...
How can I make these pictures import when the sheet is protected, I basically need it to bypass the protection.
this code works perfectly when the sheet is unlocked but once I protect it then the code does not work... I have even "unlocked" the cell the picture is being pasted in and still doesnt work
Any Ideas out there?
How can I make these pictures import when the sheet is protected, I basically need it to bypass the protection.
this code works perfectly when the sheet is unlocked but once I protect it then the code does not work... I have even "unlocked" the cell the picture is being pasted in and still doesnt work
Any Ideas out there?
Code:
Private Sub CommandButton1_Click()
Dim myPicture As Variant
Range("C13").Select
myPicture = Application.GetOpenFilename _
("Pictures (*.gif; *.jpg; *.bmp; *.tif),*.gif; *.jpg; *.bmp; *.tif", _
, "Select Picture to Import")
If myPicture = False Then Exit Sub
Dim p As Object
Dim Factor As Single
Set p = ActiveSheet.Pictures.Insert(myPicture)
'Width and Height are in points (1/72 inch)
Factor = 3.17 / (p.Width / 50)
p.Width = 230
p.Height = 173.5
End Sub