Can't Import Images into Protected Excel Workbook

Hi,

I have protected a excel workbook that needs to import images into a worksheet of this protected workbook to print in a report.

After I have selected the image I want to import into the sheet I get the following errors:
Error trying to load pic

I have a button that runs the following code to insert a image:
Sub ImageInsertion()
Dim x As Long
Dim Y As Long
Dim Z As Long
Dim AA As Long
Dim FullFileName As String
x = Selection.Height
Y = Selection.Width
Z = Selection.Top
AA = Selection.Left
FullFileName = Application.GetOpenFilename()
Select Case FullFileName
Case Is = False
Exit Sub
End Select
ActiveSheet.Pictures.Insert(FullFileName).Select
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = x
Selection.ShapeRange.Width = Y
Selection.ShapeRange.Top = Z
Selection.ShapeRange.Left = AA

End Sub`

“Error: access denied” is because you configured XLS Padlock to prevent access to the VBA editor. Excel wanted to show the VBA editor to show you the error in your code.

Thank you for the reply…
Is there a reason why it does not want to allow images to be imported into the complied workbook?

There are no errors when inserting images in the original excel workbook using the above vba code. The error only happens in the complied workbook

I compiled the workbook again to allow VBA errors to show, and this is the errors it gave:
image
and
image

Can you insert a MsgBox to show the value of FullFilename? And post the result here?

Sorry can you please advise how to do this? I am new to VBA

Just before ActiveSheet.Pictures… add this:
MsgBox FullFilename

Thanks this is what the MsgBox says
image