J
JOHNV
Hi all,
I am using C# and Word Interop to insert a chart into a Word document. Most
of the time it works fine, but at odd intervals it will just not work. I
create the chart using C#, which always works, and save it into Windows
directory. Then, I copy the chart into an open Word document. Here's my
code:
oClassType = "Excel.Chart.8";
oFileName = "someFile.xls";
Word.Shape iShape = theRange.InlineShapes.AddOLEObject(
ref oClassType,
ref oFileName,
ref doc_missing,
ref doc_missing,
ref doc_missing,
ref doc_missing,
ref doc_missing,
ref doc_missing);
Maybe 10 times in succession, it works perfectly. Then one time, the file
will not be copied, and no object reference will be returned. iShape will
just be null, and there will be no exception thrown, as far as I can tell.
Does anyone have any ideas? Your thoughts would be most appreciated!
Thanks,
Johnv
I am using C# and Word Interop to insert a chart into a Word document. Most
of the time it works fine, but at odd intervals it will just not work. I
create the chart using C#, which always works, and save it into Windows
directory. Then, I copy the chart into an open Word document. Here's my
code:
oClassType = "Excel.Chart.8";
oFileName = "someFile.xls";
Word.Shape iShape = theRange.InlineShapes.AddOLEObject(
ref oClassType,
ref oFileName,
ref doc_missing,
ref doc_missing,
ref doc_missing,
ref doc_missing,
ref doc_missing,
ref doc_missing);
Maybe 10 times in succession, it works perfectly. Then one time, the file
will not be copied, and no object reference will be returned. iShape will
just be null, and there will be no exception thrown, as far as I can tell.
Does anyone have any ideas? Your thoughts would be most appreciated!
Thanks,
Johnv