I have added a chart to a document (Excel.Chart.8) using the
Range.InlineShapes.AddOLEObject() interface. The chart happens to be inside a
content control. After saving and re-loading the document I then wish to
programatically modify the chart. If I attempt to access it using the
following code;
Word.InlineShape ils =
contentControl.Range.InlineShapes[1];
Word.OLEFormat of = ils.OLEFormat;
a "CO_E_OBJECTNOTCONNECTED" exception is thrown.
I have tried activating the control using ils.Application.Activate() or
ils.Activate() neither of which helps.
What am I doing wrong??
Andrew Wiles - 27 Jan 2007 12:00 GMT
As often happens I have answered my own question...
Ralther than activating the InlineShape I needed to activate the OLEFormat
attribute.
of.Activate();
> I have added a chart to a document (Excel.Chart.8) using the
> Range.InlineShapes.AddOLEObject() interface. The chart happens to be inside a
[quoted text clipped - 12 lines]
>
> What am I doing wrong??