• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 996
  • Last Modified:

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
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");

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.

Thanks,

Anu



0
AnuPutcha
Asked:
AnuPutcha
1 Solution
 
RejojohnyCommented:
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 ..
0
 
ta_la_lCommented:
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

0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now