nguyen_tri
New Member
- Joined
- Oct 17, 2017
- Messages
- 9
Hi I am trying to paste special an object from Excel to the word file. However, I get "member or data member not found". Here is my code:
With Selection.Tables(1).Rows(1)
Selection.PasteSpecial Link:=True, DataType:=wdPasteOLEObject, Placement:= _
wdInLine, DisplayAsIcon:=False
Selection.Object (1)
If Object(1).Height > 150# Then
.ShapeRange.LockAspectRatio = msoFalse
.ShapeRange.ScaleWidth 0.95, msoFalse
.ShapeRange.ScaleHeight 1.03, msoTrue
Else
.ShapeRange.LockAspectRatio = msoFalse
.ShapeRange.ScaleWidth 0.95, msoFalse
.ShapeRange.ScaleHeight 0.75, msoTrue
End With
What am I doing wrong here? I think the problem is I don't know how to get the object's name. Thank you so much.
With Selection.Tables(1).Rows(1)
Selection.PasteSpecial Link:=True, DataType:=wdPasteOLEObject, Placement:= _
wdInLine, DisplayAsIcon:=False
Selection.Object (1)
If Object(1).Height > 150# Then
.ShapeRange.LockAspectRatio = msoFalse
.ShapeRange.ScaleWidth 0.95, msoFalse
.ShapeRange.ScaleHeight 1.03, msoTrue
Else
.ShapeRange.LockAspectRatio = msoFalse
.ShapeRange.ScaleWidth 0.95, msoFalse
.ShapeRange.ScaleHeight 0.75, msoTrue
End With
What am I doing wrong here? I think the problem is I don't know how to get the object's name. Thank you so much.