LinkFormat.AutoUpdate error

D

DFKT

Hi all,

I'm trying to generate a script that
1) pastes a Excel selection as a linked Metafile Picture and
2) adjusts the properties of the pasted picture, amongst which the
AutoUpdate property (which needs to be set to False)

-------------------

Selection.Collapse Direction:=wdCollapseStart
Selection.PasteSpecial Link:=True, DataType:=wdPasteMetafilePicture, _
Placement:=wdInLine, DisplayAsIcon:=False

Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
If Selection.Type = wdSelectionInlineShape Then
With Selection.InlineShapes(0)
.LinkFormat.AutoUpdate = False
.LockAspectRatio = msoTrue
wShape = .Width
hShape = .Height

wShapeN = CentimetersToPoints(16)
.Width = wShapeN
.Height = wShapeN / wShape * hShape
End With
End If

-------------------

I had a working script running, but now all of a sudden I get a "run-time
error 4198" on the
.LinkFormat.AutoUpdate = False
line in the code.

I have absolutely no idea why it won't execute, since the InlineShapes
object is properly returned and recognized (if I bring the .LockAspectRatio
property to the front, that one does execute).

Maybe someone here has a clue to what is the problem, and maybe a workaround
for this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top