I am at a loss. I've tried all examples I've found on this site and others but still can not determine if an object exists and if so, copy to the same sheet and location in another workbook.
I have this version which works great if the object is there to copy. Problem is I need the code to determine if it's there or not and if not move on. And also target a specifically named object that I insert. I can't always assume it will be "Picture 10" so I name it "Logo" when I embed it.
I've tried If statements to determine if "Logo" is nothing but it just stops there and does not move on. I've seen dozens of examples I've tried but nothing works for some reason. I know the object is there and labeled "Logo" as I can click on it and that's what shows in the name field.
Any help would be appreciated.
Thanks
I have this version which works great if the object is there to copy. Problem is I need the code to determine if it's there or not and if not move on. And also target a specifically named object that I insert. I can't always assume it will be "Picture 10" so I name it "Logo" when I embed it.
Code:
Set targetsheet = Targetbook.Sheets("workbook_cover")
Set sourcesheet = Sourcebook.Sheets("workbook_cover")
Set shp = sourcesheet.Shapes("PICTURE 10")
shp.Copy
With targetsheet
.Paste
With .Shapes(.Shapes.count)
.Left = shp.Left
.Top = shp.Top
End With
End With
I've tried If statements to determine if "Logo" is nothing but it just stops there and does not move on. I've seen dozens of examples I've tried but nothing works for some reason. I know the object is there and labeled "Logo" as I can click on it and that's what shows in the name field.
Any help would be appreciated.
Thanks