Excel COM Chart.Export throws COMException

Hi there,

I am trying to export a chart using the Excel11 object from within ASP.NET. 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
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");

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.

The person who posted a similar question before answered his own question as :

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).

But I haven't unerstood anything from his answer,  I would appreciate it if someone can explain it to me what to do.



Who is Participating?
what i understand from the solution u have pasted is that the ASP.net user requires access to the MSI Installer COM object .. as the asp.net user is not interactive means that he has never logged on into the computer, the user profile is not created and so the he does not have any graphic filters for that user in the registry ...

so giving ASP.net user access services "Windows Installer" C:\WINDOWS\system32\msiexec.exe
should solve ur problem or just loggin on to ur PC as ASP.net users .. but then u should be aware of the password ..
Hi guys, I have the same problem, and I tried this solution but it doesn't work,
and I gave the permission to "Network Services" because it's on Win Server 2003, and when it didn't work I add ASPNET and gave it FULL control but still the same error !!!
do we need to restart the server to make it work,

Please help me !

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Exception Details: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC
Source Error: 
Line 115:                c = CType(.ChartObjects(1).Chart, Excel.Chart)
Line 116:
Line 117:                c.Export(imagePath, "JPG")
Line 118:
Line 119:

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.