Chart.Export throws COMException (0x800A03EC)

  • Thread starter Benchmark Developmer
  • Start date
G

Gato Gato

I see that this is a pretty old post, but I just ran into the same issue and took me a while but finally figured out the solution.

The Sintax for the Export method of the Chart object is:

expression.Export(Filename, [FilterName], [Interactive]) as described at http://msdn.microsoft.com/en-us/library/aa195722(office.11).aspx

Now, even though the FilterName and Interactive parameters are optional, and should not represent trouble at all, the Interactive one is the one that does.

This parameter should be set to True to display the dialog box that contains the filter-specific options and, as the user is not at the server, the parameter should be set to False. The default value is False, but when using the object from outside VBA (like in this case, creating it in C#.NET), it doesn't take it as False and an Exception is raised.
So, on line 66 where you have:

objexcel.ActiveChart.Export("C:\Inetpub\wwwroot\spreadsheets\sav\test.gif", "gif")

it should be

objexcel.ActiveChart.Export("C:\Inetpub\wwwroot\spreadsheets\sav\test.gif", "gif", False)

and that should solve the problem.

Lucas
 
P

Peter Flannery

I ran in to this problem with Excel 2003 and after trying the solution posted by Gato Gato I still got the same error.

I found that instead of passing a C# Bool type for the Interactive parameter, pass it with a String type instead. i.e. "False"

objexcel.ActiveChart.Export("C:\Inetpub\wwwroot\spreadsheets\sav\test.gif", "gif", "False")

Hope this helps....
I can't get past this error. I'm using C#, creating a chart and want to
export it. I've seen this here

http://www.hightechtalks.com/csharp/chart-export-throws-comexception-0x800a03ec-235007.html

But it doesn't give any steps to rectify the issue. Anyone have any ideas?
On Friday, August 27, 2010 3:00 AM Gato Gato wrote:
I see that this is a pretty old post, but I just ran into the same issue and took me a while but finally figured out the solution.



The Sintax for the Export method of the Chart object is:



expression.Export(Filename, [FilterName], [Interactive]) as described at http://msdn.microsoft.com/en-us/library/aa195722(office.11).aspx



Now, even though the FilterName and Interactive parameters are optional, and should not represent trouble at all, the Interactive one is the one that does.



This parameter should be set to True to display the dialog box that contains the filter-specific options and, as the user is not at the server, the parameter should be set to False. The default value is False, but when using the object from outside VBA (like in this case, creating it in C#.NET), it doesn't take it as False and an Exception is raised.

So, on line 66 where you have:



objexcel.ActiveChart.Export("C:\Inetpub\wwwroot\spreadsheets\sav\test.gif", "gif")



it should be



objexcel.ActiveChart.Export("C:\Inetpub\wwwroot\spreadsheets\sav\test.gif", "gif", False)



and that should solve the problem.



Lucas
Submitted via EggHeadCafe
Obsessive Defragmentation Disorder (ODD) and You
http://www.eggheadcafe.com/tutorial...ive-defragmentation-disorder-odd-and-you.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top