Solved

Excel COM Chart.Export throws COMException

Posted on 2003-11-04
1
789 Views
Last Modified: 2007-12-19
Hi there,

I am trying to export a chart using the Excel11 object from within C#.  I can
properly open workbooks and read cells, but calling Export() on the Chart
object throws the following COMException

Exception: System.Runtime.InteropServices.COMException (0x800A03EC):
Exception from HRESULT: 0x800A03EC.
at Excel._Chart.Export(String Filename, Object FilterName, Object
Interactive)
at MBCCS.LeParc.Importer.Importer.GetImageInfoFromWorksheet(Worksheet
worksheet) in d:\source\leparc\importer\importer.cs:line 211

The line causing this is:

tempChart.Chart.Export(filename, "JPEG", Missing.Value);

The JPEG filter is registered.

I am trying to export a picture from excel to an external file.  What I am doing is creating a new
chart, copying the picture to the chart, then exporting the chart.  The
Excel process is running under the ASPNET account.

Any help would be greatly appreciated.

Thanks,
0
Comment
Question by:sberkovitz
1 Comment
 

Accepted Solution

by:
sberkovitz earned 0 total points
ID: 9684539
OK Figured it out.

The problem was that the ASPNET user account didn't have access to the MSI Installer COM object.  What was happening is that the .Export() method searches the HKCU registry key for available graphic filters.  Because the ASPNET user is not an interactive user, no user profile had been created for it, and calling the .Export() method prompted MSI to create the profile (including the HKCU hive).
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question