I get COMException while exporting chart on IIS 6.0.

I have this code that works perfectly on my development machine when I 
deployed it at customer site it gets exception. Here is the error and my code:

thanks

error
==========
Exception from HRESULT: 0x800A03EC. 
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: 

An unhandled exception was generated during the execution of the current web 
request. Information regarding the origin and location of the exception can 
be identified using the exception stack trace below.  

Stack Trace: 


[COMException (0x800a03ec): Exception from HRESULT: 0x800A03EC.]
   Excel._Chart.Export(String Filename, Object FilterName, Object 
Interactive) +0
   apac2.WebForm1.copyDataAndRunMacro(String fName, String eventdir)
   apac2.WebForm1.uploadButton_Click(Object sender, EventArgs e)
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler 
sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1292

 

my code
========
			Excel.Range chartRange = dstMsh.get_Range("B15", "D" + 
chartData.ToString());
			Excel.ChartObjects chObjs = 
(Excel.ChartObjects)dstMsh.ChartObjects(Type.Missing);
			Excel.ChartObject chObj = chObjs.Add(100, 200, 400, 300);
			Excel.Chart chart = chObj.Chart;

			chart.SetSourceData(chartRange, Type.Missing);
			chart.ChartType = Excel.XlChartType.xlBarClustered;

			string imgDir = "C:\\inetpub\\wwwroot\\apacevent\\images\\";
			string imgSaveAs = getCurrentTime()+ "_chart.gif";
			chart.Export(imgDir + imgSaveAs, "GIF", false);

			imgChart.Visible = true;
			imgChart.ImageUrl = "images\\" + imgSaveAs; 

0
Newbie (61)
5/16/2006 2:05:01 AM
excel.charting 18370 articles. 0 followers. Follow

1 Replies
522 Views

Similar Articles

[PageSpeed] 2

Hi,

I have no idea why you code is not working but does it make sense to 
name your variable, chart, with the same name as an existing excel 
object type?

Cheers
Andy

asp newbie wrote:
> I have this code that works perfectly on my development machine when I 
> deployed it at customer site it gets exception. Here is the error and my code:
> 
> thanks
> 
> error
> ==========
> Exception from HRESULT: 0x800A03EC. 
> 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: 
> 
> An unhandled exception was generated during the execution of the current web 
> request. Information regarding the origin and location of the exception can 
> be identified using the exception stack trace below.  
> 
> Stack Trace: 
> 
> 
> [COMException (0x800a03ec): Exception from HRESULT: 0x800A03EC.]
>    Excel._Chart.Export(String Filename, Object FilterName, Object 
> Interactive) +0
>    apac2.WebForm1.copyDataAndRunMacro(String fName, String eventdir)
>    apac2.WebForm1.uploadButton_Click(Object sender, EventArgs e)
>    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
>    
> System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
>    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler 
> sourceControl, String eventArgument) +18
>    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
>    System.Web.UI.Page.ProcessRequestMain() +1292
> 
>  
> 
> my code
> ========
> 			Excel.Range chartRange = dstMsh.get_Range("B15", "D" + 
> chartData.ToString());
> 			Excel.ChartObjects chObjs = 
> (Excel.ChartObjects)dstMsh.ChartObjects(Type.Missing);
> 			Excel.ChartObject chObj = chObjs.Add(100, 200, 400, 300);
> 			Excel.Chart chart = chObj.Chart;
> 
> 			chart.SetSourceData(chartRange, Type.Missing);
> 			chart.ChartType = Excel.XlChartType.xlBarClustered;
> 
> 			string imgDir = "C:\\inetpub\\wwwroot\\apacevent\\images\\";
> 			string imgSaveAs = getCurrentTime()+ "_chart.gif";
> 			chart.Export(imgDir + imgSaveAs, "GIF", false);
> 
> 			imgChart.Visible = true;
> 			imgChart.ImageUrl = "images\\" + imgSaveAs; 
> 

-- 

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
0
andy9699 (3616)
5/16/2006 7:27:59 AM
Reply:

Similar Artilces:

Has Anyone ever seen a chart like this?
Looking for some help. I need to know what this column chart is called? Or how to make it? 'CLick Here to View Chart' (http://www.f150online.com/galleries/pictureview.cfm?pnum=163585&anum=11244) I can't find any option in Excel to make this chart. Maybe it was not made in Excel? Or I need a specific plugin? -- TsunamiBob ------------------------------------------------------------------------ TsunamiBob's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=36202 View this thread: http://www.excelforum.com/showthread.php?threadid=559874 Hi, It...

Exporting file names to an excel spreadsheet.
I have a folder containing many many many .pdf files. Is there a way to export the filenames of these .pdf files into an excel spreadsheet? If this is a dumb question, I apologize. I didnt have any luck searching for the answer here. -- Kepf ------------------------------------------------------------------------ Kepf's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30611 View this thread: http://www.excelforum.com/showthread.php?threadid=547520 I use Jim Cone's fine Add-in called "ListFiles"for this sort of thing. It's available free (a...

Get at messages in queue
Is it possible to get at the undeliverable messages that are held in a queue (eg to check the message body or redirect undeliverable messages). I would like to be able to selectively forward them to an alternate email address or to archive them to a PST etc rather than just deleting them? Thanks Alan ...

charting newdata
Formula or VBA? I am trying to create a formula to assign a region to populate a chart. I know there is a way to use the OFFSET function to point ot a certain section of a data sheet, but what if i insert a line between the title and the data.(done programmactically)? the problem is that inserted lines do not automatically include into the data range for a chart. The data wants to be sorted from newest to oldest. Would it be easier to create a formula to assign a 'chart data area' or simply reassign the data area every time the table is updated Thanks for the input. ...

chart label reference based on the column number
In a worksheet with an embedded chart, I have a cell, S4, where I enter the number of the column I want to chart (these numbers are listed as labels in cells A2:R2). I can't figure out how to translate the number in S4 into the corresponding column letter. For example, if S4 contains "3", the chart title should be =$C$2. I think working with absolute references, R1C1, might be easier here, but somehow what I've tried, didn't work (the entire spreadsheet is based on relative addresses (A1). z.entropic in a cell (Z100) put =index(A2:G2,1,S4,1) Change G2 to whatev...

How to get XML data out of an XML file
I am trying to retrieve the Parameters first or second (0, 1 ,2) node from the following XML file: <?xml version="1.0" encoding="utf-8" ?> <Robot xmlns="http://tempuri.org/RobotDefaults.xsd"> <Parameters> <Name>Decker</Name> </Parameters> <Parameters> <Name>A</Name> </Parameters> <Parameters> <Name>B</Name> </Parameters> </Robot> There will be more data than just a name for each Parameters node. Here is my code: Dim node As XmlNode = xmlDocument.SelectSingleNode("/P...

Mailbox Restore #6
Hi! Im about to restore a SBS 2003 server with exchange (2003) after a system crash. I don't want to restore over my new installed machine, so what's the easiest way? Im only interested in the mailboxes and public folders content. Software for extracting directly fom edb files are to expensive, or is there any cheap one? :-) /Jonas On Sun, 5 Mar 2006 18:36:24 +0100, "Jonas Nilsson" <jonas_nilsson@hotmail.com> wrote: >Hi! > >Im about to restore a SBS 2003 server with exchange (2003) after a system >crash. > >I don't want to restore over my ...

How to get paper size from dmPaperSize returned from GetDevMode?
For example, dmPaperSize returns 1 which is DMPAPER_LETTER, how do I calculate the paper size like in this case 8.5"x11"? There are so many paper sizes, is there any function call to calculate based on the return value of dmPaperSize or mapping between the value of dmPapersize and actual size? Thank you. The reason I asked the question was because dmPaperLength and dmPaperWidth are 0 for some printers. Also, my HP laserjet returns as a color printer (dmColor = 2) from GetDevMode call. Anyone knows why? ...

does vista installed on virtual machine 2007 get wsus updates ?
It is searching for updates but it is not finding anything and saying that Windows is up to date. I have set the updates to install from the wsus server and assigned the updates to the same Vista virtual machine .. Thank you -- aconti ------------------------------------------------------------------------ aconti's Profile: http://forums.techarena.in/members/73272.htm View this thread: http://forums.techarena.in/active-directory/1290161.htm http://forums.techarena.in Hello aconti, If the machine is getting the correct GPO for the WSUS settings, check with rsop...

4.0 Acceleration Software?
Have heard tell of a software "maybe called accelerate" that can be installed on the CRM server, which will increase speed and performance. My clients are complaining of slowness since crm has been installed. They all use Outlook client for desktop, and say there is a definite latency. I've been searching the web, but coming up empty on a software for this. Is it an urban myth or a secret that needs to be be shared? ...

Baseball Stats question: How can I get the RBI's?
I have a data table that looks like this: Code ------------------- STR-S SNK-S STR-K STR-F SNK-S STR-3 STR-2 STR-F SNK-S SNK-4 SNK-S STR-3 SNK-F STR-4 STR-O ------------------- "STR", etc at the beginning are pitch types, SNK is Sinker for example The end character is the result of the pitch, a 4 would be a home run, 3 a triple, and so forth. O is out, F is foul, S is strike --- you ge it. How can I figure the amount of RBI's? I know that it's 5, but I can' think of any automated way to calculate this, anyone got any ideas? THANK YOU!! :confused -- AVER...

DEADLINE... PLEASE HELP! Stacked Bar chart?
I'm not even sure how to ask the question so here's what I have... 2003 2004 2005 Actual/Goal Actual/Goal Actual/Goal Me 1009/1061 591/866 658/897 Comp. A 966/1012 633/811 624/808 Comp. B 699/744 450/593 480/607 Comp. C 957/1005 642/821 665/838 I wanto to show a bar for each competitor, for each year, so there will be 4 bars for each year. Each bar showing Actual performance & Performance Goal...

I deleted my Public Folder under IIS By Mistake
I have deleted my Public Folder Virtual Folder in the IIS Manager by Mistake How can I re-create this so that users can use the Public Folders through OWA again Any help Cheers, You have a back up strategy every night right? If so copy it from the back up, if not, you need to have all of yoru databases log files. try this; http://support.microsoft.com/default.aspx?scid=kb;en-us;313184 ...

z-order of various lines and bars in an Excel 2007 chart
What is the procedure for changing the z-order of various lines and bars in an Excel 2007 chart, such as drop lines, high-low lines, up/ down bars, and error bars? I observed that when I add drop lines to an Excel 2007 chart, they appear in front of the underlying data -- in my case, the underlying data is displayed as a plotted area. I want the plotted area to be fully visible with no lines over it. I would like to send the drop lines to the back and keep the plotted area in the front, but there is no option to do this. So, is there a procedure for adjusting the z-order of drop...

Getting Cell Value from the Concatenate formula
I built a concatenate formula that returns the following result: =Jul! $D27 I am looking for the cell contents of Sheet: July Column D Row 27. I tried to use offset, but I am stumped. Can I add something to the front of the concatenate to not only build the reference to the cell, but also return the value instead of the =Jul!$D27 ? Thanks John =indirect(yourformulahere) Don't include the equal sign in your formula. And match the name correctly (Jul or July???). Depending on the name of the worksheet, you may need to have a string that looks like: 'Sheet 99'!d27 =indirec...

Can't get rules to run.
I can't get Outlook 2003 rules to run. I am getting my mail from a pop3 account and would like to have new mail sorted to specific folders when it arrives. I set up the rules as I did in previous versions of outlook, but they do not run automatically. I can run the rules manually and they will move the mail. I have this rule (for example Apply this rule after the message arrive from some@email.address and on this machine only move it to the somefolder folde I have tried deselecting on this machine only Thanks. Do you have an Exchange service in this profile? Are you using Cache...

How do I lock a chart so it will not update?
That's the question. I have my data in Excel and the chart in Excel but not all the data cells are used. Everytimg I open the chart it wants to update and I want it to stay the same. Any ideas on how to lock the chart? Hi Just a few ideas: You could lock the cells that are shown in the chart. Or you could copy the cells and paste as values (assuming formulas were used that update when other cells change). -- Wigi http://www.wimgielis.be = Excel/VBA, soccer and music "Locking a Chart" wrote: > That's the question. I have my data in Excel and the chart in ...

How can I reset the default pie chart label "Other" to "Equity"?
I show Cash, Equities, and Fixed Income in the large pie to the left. The equity slice is further split into large, medium, and small. The problem is that the Equity slice gets relabeled as "Other". When I manuallly change it back to Equity, I lose the ability to link to any new data...so I can't use the pie chart as a template that would allow me to put new data in the table and have the pie chart adjust automaticially. How can I reset the default pie chart label to "Equity"? or is there another solution. Instead of making pie charts (which are notor...

Getting same number to appear over and again
Hi. I'm trying to change the E's I have entered in a column to 1's. However, in lieu of changing them one by one, I would like to do them all in one fell swoop. Any suggestions? John Hi John You could use find and replace. Select all of your data. Goto Edit>Find Find what:- E Replace with:- 1 HTH Martin John Do NOT multipost. See your answer in Excel group. And do a google search for newsgroup etiquette!! John Do NOT multipost. See your answer in Excel group. And do a google search for newsgroup etiquette!! John Do NOT multipost. See your answer in Excel ...

Office 2004 SP 11.1.0 installation problems
I'm trying to update Office 2004 on my brand new iBook. I installed Office 2004 from the CD without incident. Then I downloaded SP 11.1.1.0 and 11.1.0 (which according to the MS website is to be installed 1st.) When I try to install, I received a message, "An error prevented the update from completing 11002:2,-14" The "Read Me" file indicates several potential explainatins/solutions none of whice are relevant except for uninstalling Office and then reinstalling it. I tried dragging the Office folder to the trash and reinstalled and am having the same problem. I've t...

Why do my questions get deleted sometimes?
Apologies, I have posted this on the worksheet functions group too... I love the feedback I get from these groups, but every now and then, my messages get deleted. I'd like to know what I'm doing wrong. Many of my messages ARE posted and answered, and I'm grateful for that, but one or two get removed - regardless of how often I post them. I don't swear or say anything bad about Excel - I love it. So why don't they get posted are there some words or subjects that I should avoid? Will this one get deleted - it's a bit off subject? But I'd love to have an ans...

modify contact address when account address gets modified
Hi, How do I ripple my changes from company level to the related contacts ? For example the main company phone number and the main address ? Do I need a product like Scribe for this, or can this be done with the workflow ? Thanks for any advice Wim You can't do this with workflow, and I don't believe Scribe can do this (though I may be wrong - I've only used Scribe for one project). I would think that you'd need to create a post callout using the SDK. There is more info at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/CrmSdk1_2/htm/v1d2microsoftcrmversi...

Become MCSE Certified and get $43,000+ Salary per year
QmVjb21lIE1DU0UgQ2VydGlmaWVkIGFuZCBnZXQgJDQzLDAwMCsgU2FsYXJ5IHBlciB5ZWFyCkhp LApTdGFydCB5b3VyIGJyaWdodCBjYXJlZXIgd2l0aCBNQ1NFIENlcnRpZmljYXRpb24gYW5kIGdl dCAkNDMsMTIyLjUwCihhY2NvcmRpbmcgdG8gYWJvdXQuY29tIHNhbGFyeSBzdXJ2ZXkpLiBWaXNp dCBodHRwOi8vd3d3LkZyZWVFeGFtS2luZy5jb20KZm9yIE1DU0UgQ2VydGlmaWNhdGlvbiwgRnJl ZSBQcmFjdGljZSBFeGFtcywgRnJlZSBTdHVkeSBNYXRlcmlhbCAvCkJvb2tzIGFuZCBGcmVlIER1 bXBzIIWFCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09Cg== ...

Chart Wizard #5
Does excel 2007 have a chart wizard? If so, how do I access it? The chart wizard no longer exists in Excel 2007, RIP. You create a chart using the various chart buttons on the Insert tab, then struggle through the three Chart Tools contextual tabs looking for the controls to set up the chart. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Liberty" <Liberty @discussions.microsoft.com> wrote in message news:7C1186EF-4C15-4E3D-A642-D0EA334C1192@microsoft.com... > Does excel...

Easy dynamic chart.
Creating a dynamic chart is difficult, there should be a dynamic chart wizard that will create it with you. Also if my serie value is a name range, it would be nice to just right the Name range directly not with the complex formula. ='xyz.xlsx'!name range but just name range. xyz and name range is a fictive value. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the...