Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Graphics / May 2008

Tip: Looking for answers? Try searching our database.

Insert Excel Chart into Word document fails intermittently

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JOHNV - 13 May 2008 07:18 GMT
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
JOHNV - 14 May 2008 00:11 GMT
Once I isolated the problem code, here is the exception information:

The server threw an exception. (Exception from HRESULT: 0x80010105
(RPC_E_SERVERFAULT))

It's almost as if the server goes on break every so often, and is not
available.

Any thoughts??

Thanks,
John

> Hi all,
> I am using C# and Word Interop to insert a chart into a Word document.  Most
[quoted text clipped - 23 lines]
> Thanks,
> Johnv

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.