C
crimsonkng
Here's a small portion of my macro:
Sheets("Result").Select
Rows("1:4").Select
Selection.Insert Shift:=xlDown
Range("E4").Select
ActiveSheet.Pictures.Insert("C:\v1logo.gif").Select
Selection.ShapeRange.IncrementLeft -12#
Selection.ShapeRange.IncrementTop -19.5
ActiveSheet.Shapes("Picture 1").Select
Selection.ShapeRange.IncrementLeft -20.25
Selection.ShapeRange.IncrementTop -0.75
Range("A1").Select
After years of using this, all of the sudden, I'm getting an error at the
8th line, above:
ActiveSheet.Shapes("Picture 1").Select
Excel can't find Picture 1 because, for some reason, the v1logo.gif file is
called Picture 7. Yesterday, Excel thought it was Picture 4. But for years
and years, it's been inserted as Picture 1 so there was never any problem.
I closed Excel and reopened it, thinking that it would think that it would
"reset" to Picture 1, but it didn't.
Any idea how to overcome this error? In the macro, can I call Picture "X"
instead of a specific Picture number? Or, can I say "whatever picture was
just inserted?"
Thanks.
Sheets("Result").Select
Rows("1:4").Select
Selection.Insert Shift:=xlDown
Range("E4").Select
ActiveSheet.Pictures.Insert("C:\v1logo.gif").Select
Selection.ShapeRange.IncrementLeft -12#
Selection.ShapeRange.IncrementTop -19.5
ActiveSheet.Shapes("Picture 1").Select
Selection.ShapeRange.IncrementLeft -20.25
Selection.ShapeRange.IncrementTop -0.75
Range("A1").Select
After years of using this, all of the sudden, I'm getting an error at the
8th line, above:
ActiveSheet.Shapes("Picture 1").Select
Excel can't find Picture 1 because, for some reason, the v1logo.gif file is
called Picture 7. Yesterday, Excel thought it was Picture 4. But for years
and years, it's been inserted as Picture 1 so there was never any problem.
I closed Excel and reopened it, thinking that it would think that it would
"reset" to Picture 1, but it didn't.
Any idea how to overcome this error? In the macro, can I call Picture "X"
instead of a specific Picture number? Or, can I say "whatever picture was
just inserted?"
Thanks.