Accessing a excel chartobject in word

P

PeterS

Hi All,

I'm using office 2007.

In some previous posts (from Jean-Guy Marcil ) I found a snipplet how to
access embedded OLE objects (ChartObject in word doc) and I tried following:
Sub Chart_Test_02()

Dim o_OLE As Word.OLEFormat
Dim e_Chart As Excel.ChartObject

For ISCnt = 1 To ActiveDocument.InlineShapes.Count
IST = ActiveDocument.InlineShapes.Item(ISCnt).Type
If IST = wdInlineShapeChart Then
ActiveDocument.InlineShapes.Item(ISCnt).Select
Set o_OLE = ActiveDocument.Shapes(ISCnt).OLEFormat
o_OLE.DoVerb wdOLEVerbPrimary
SET e_Chart = o_OLE.Object ===>> here comes "Syntax error"

End If
Next ISCnt

End Sub
<<<<<

I get allways this syntax error. I have no idea why. Do you have any idea?
 

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