Solved

Excel COM Chart.Export throws COMException

Posted on 2003-11-04
1
785 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now