judgejustin
Board Regular
- Joined
- Mar 3, 2014
- Messages
- 139
I have been using the code below for years and it has always worked. It has always been assigned to a button that was on the same worksheet it placed the values in. I have just recently attached this code to a different button in a different worksheet but in the same workbook. I did this to make it a simpler process for the users.
If I run the code from the new button it places the picture in the correct sheet but several cells higher than the stated range. It does not place the data at all. I have added a button back into the original sheet and linked the same code to it, so both button run the exact same code, and the button in the original sheet again works perfectly.
What am I missing???
Code:
Sub Stage1Certification_Button_Click()
Dim myFiles, e
myFiles = Application.GetOpenFilename(, , , , True)
If Not IsArray(myFiles) Then Exit Sub
For Each e In myFiles
With Worksheets("Stage 1 Certification")
.Protect "dorcusreview", UserInterFaceOnly:=True, DrawingObjects:=True, Contents:=True, Scenarios:=True
Worksheets("Stage 1 Certification").Shapes.AddPicture (e), False, True, Range("D46:D49").Left, Range("D46:H46").Top, Range("D46:H46").Width, Range("D46:D49").Height
With Worksheets("Stage 1 Certification")
Range("D52").Value = Date
End With
End With
Next
End Sub
What am I missing???