I have a pice of code that works well to place a .Gif file to a specific location in a spreadsheet. However, I need to change the directory dependant upon a user path and am having some problems. I obtain the path via a user form and dump this to an excell cell, but if I try to reference that cell in place of the C:\My Documents\Gallery\ it fails.
Here's the original code:-
[P17].Select
Set Gif = ActiveSheet.Pictures.Insert( _
"C:\My Documents\Gallery\Shapes.gif")
With Gif.ShapeRange
.IncrementLeft -1.5
.IncrementTop -1.5
.ZOrder msoSendToBack
End With
Sheet4.Select
If I then change it to the following it also fails as an "Unable to get insert property of the picture class"
With Sheet4.[A6].Select
Dim Gif As Object
Dim x As Integer
Dim i As Integer
Dim Z As String
Z = Sheet2.Cells(44, 3)
Set Gif = ActiveSheet.Pictures.Insert(Z)
With Gif.ShapeRange
.IncrementLeft 50
.IncrementTop 0
End With
End With
Can anyone give me a clue please?
CodMan
Here's the original code:-
[P17].Select
Set Gif = ActiveSheet.Pictures.Insert( _
"C:\My Documents\Gallery\Shapes.gif")
With Gif.ShapeRange
.IncrementLeft -1.5
.IncrementTop -1.5
.ZOrder msoSendToBack
End With
Sheet4.Select
If I then change it to the following it also fails as an "Unable to get insert property of the picture class"
With Sheet4.[A6].Select
Dim Gif As Object
Dim x As Integer
Dim i As Integer
Dim Z As String
Z = Sheet2.Cells(44, 3)
Set Gif = ActiveSheet.Pictures.Insert(Z)
With Gif.ShapeRange
.IncrementLeft 50
.IncrementTop 0
End With
End With
Can anyone give me a clue please?
CodMan