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
507 Views

Similar Articles

[PageSpeed] 59

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:

Creating a mix of column and scatter chart on one chart.
Please help! I am trying to show a possible effect that a count rate has on whether a specific test is succesful or not. I have 2 sets of data both of which are measures of same parameter (i.e count rate). I wish to display each set as either having passed or failed a particular test. So I need a column of points that have passed and a column that have failed (the count rate should be along the y-axis). I also wish to display the mean and standard deviation of each passed count rate and failed count rate. Hi, Could you show us dummy data that shows us what your data layout and valu...

Chart- View Labels- Shared Database...
I am working out of a database used by two other individuals. When I attempt to print a report, my chart does not display the labels. If I open the chart in design view, I am unable to view the labels, but if I go further and actually open the chart all information is displayed. The other individuals working in the database are able to readily review the reports and print the data without any problem. We are all using the Access version, and I have already installed the Office Service Pack 3 fix. Nothing seems to working. Any assistance is greatly appreciated. ...

export-mailbox cmdlet
Good afternoon! EXCH2007 SP2 | MS Outlook 2007 environment. Have a client for whom I recently 'exmerged' a user's mailbox. I 'exmerged' the entire mailbox and then 'exmerged' just the last 90 days (did this on 04/02/2010). The cmd that I used for the "90-day" process is this: export-mailbox -Identity "Joe.Blow" -StartDate 01/01/2010 -EndDate 04/01/2010 -PSTFolderPath D:\PSTFiles\90Days\jblow.pst The issue is that I see nothing - except the Calendar items. Nothing in the Inbox, in any of the many many sub-folders, Sent Item...

exporting/importing databases
Can someone tell me if it is possible to bring a database created in microsoft access into microsoft publisher 2002. any suggestions, I am trying to create a mailing list and I have about 900 entries to transfer. thanks ...

NumberFormat not getting changing onFly changing the regional sett
Hi Excel experts , Sorry for posting a new question over here. I am having a hard time with one of a Excel related issue. Requirement: 1) User pulls some data ( includes numeric,Date fields ) to excel when he/she is with German OS settings. Date show in following format: dd.mm.yyyy ( eg: 23.09.2010) 2) Now on the fly he/she changes the OS regional settings to En-US 3) Here our code again reformats those columns with current regional settings and polish the data according to its regional settings. 4) In our case all numeric values are getiing changed correctly to the ...

Scatter chart displays as line chart
I'm trying to connect point on a (background graphic) circle with lines (using Excel 2000). I have generated the X-cordinates for all ends of lines in one column and, in each of the following columns, I have the Y-cordinates for one line, two values next to each other; in the same rows as their X-coordinates. All other cells are empty. This works in smaller scale but when I have 250 lines, the X-values are replaced with rising numbers, i.e. I get a line graphic. Is there any way to make the scatter graphic work in large scale figures? Thanks Hi, Have you used the xy-scatter type ...

Data to Chart Question/How-to
Below is my data layout as it is right now. What I want my chart to look like is described as... The Vertical Left Area is the Document ID Column The Horizontal Bottom Row is the Reviewer (Revwr #?) The Secondary Vertical Right is the Days Overdue Numbers So far I've tried to use a Scatter, Line, Bar, and also Combining them too but nothing seems to yield the results I am looking for. I hope that the data outline below shows up well enough but if not then let me know and I'll try again. Document ID Revwr #1 Revwr #2 Revwr #3 Revwr #4 Days Overdue Document #001 X X ...

Get GUID of device
Does anyone have idea of how to get the GUID (Global Unique Identifier) for a device. ex. harddisk thx. ...

1 company will not upgrade to 10.0
One of our companies will not upgrade from 9.0 sp3 to 10.0 sp1. The below messages appear. The following SQL statement produced an error: if exists (select * from sysobjects where id = object_id('dbo.GPS_CHAR') and sysstat & 0xf = 6) drop default dbo.GPS_CHAR ERROR [Microsoft][SQL Native Client][SQL Server]The default 'dbo.GPS_CHAR' cannot be dropped because it is bound to one or more column. ...

Proportional bar width in charts?
I am trying to create a bar chart where the width of the bar is the "X" value and the height of each bar is the "y" value. I am trying to create a chart similar to the Vattenfall CO2 abatement chart, which I have discoveed cannot be pasted into this posting <sorry about that> Thanks for any advice On Fri, 28 Sep 2007, in microsoft.public.excel.charting, Peter M <Peter@M.?.microsoft.com.invalid> said: >I am trying to create a bar chart where the width of the bar is the "X" value >and the height of each bar is the "y" value. ...

Creating the occurrence frequency chart in Excel
I had a need to put a series of numbers into buckets of size 5. I created the following formula, and "dragged it down" =A1 + IF(MOD(A1,5), 5-MOD(A1,5), 0) I am sure that there is a better way of doing this. Can someone suggest it? Also, I wanted to come up with an occurrence frequency chart for my data. For example if I have numbers 4, 9, 13, 13, 17, 19, 19, 19, then I would like the occurrence frequency chart to plot the following informatiuon in a 2D chart: 0-4: 1 5-9: 2 10-14:2 15-30: 3 Thanks, Song Hi: This will work out the buckets for you. Paste it into the first cel...

excel charts look drastically different on different computers
When we open excel charts on different computers in our office the formatting looks drastically different (for example, data labels and arrows on charts are in different locations). This is a huge problem because it means that the formatting has to be fixed each time someone opens an excel chart. This was never a problem until recently when some of our staff got new computers and for a short time they were using Office 2007 (everyone else in the office was using Office 2003). We've switched everyone back to Office 2003, but the problem with excel charts persists. When u ad...

Need better understanding of TRIM so I can get rid of trailing spa
I imported a listof names to creat labels. All columns have trailing spaces. I have imported some into Word then done a relace it worked but it was a not the right solution. I understand TRIM in Excel will get rid of Trailing spaces. The examples HELP gives is not clear to me. Please help me get rid of these trailing spaces. Tom Trim should work, Tom, but it's tough to say without seeing your data. What happens if you open the data directly from Excel? What format is it now? Any txt file opened from Excel should give you delimiter options. Are the number of trailing spaces always ...

How to get rid of the backgound color?
Hi! I use excel 97 I took from a CD that was comming with a book an invoice.xls. I finally just kept the desing of the invoice, getting rid of all the macros and other progamming that was making it work. I made my ow boxes and macros. My problem is that there is this dark green background color that don't like. In fact, the hole sheet is that color up to the last colu and row. Also, if I add a new sheet to this .xls, it is all green an without the lines horizontals and verticals. I never found where to change that! Can you help? Alai -- Message posted from http://www.ExcelForum....

Getting any formula to stop at the next blank space
I frequently write VLOOKUP and SUMIF formulas for my spreadsheets an have found myself typing the same thing over and over. How can I ad in a command that makes each formula stop at the next blank. I als have to make the formula references "absolutes". What I'm wanting t do is copy and paste the same formula down without sacrifices th absolute references -- ajpower ----------------------------------------------------------------------- ajpowers's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=940 View this thread: http://www.excelforum.com/showth...

Font size changes in Excel 2003 charts when re-opened
For certain charts that I create within Excel 2003 (usually bar charts), I use a font size of 8 (eg for data labels, axis labels, and scale). If I close the file and then re-open it, all these fonts will have become size one (title and legend are not effected). Oddly, if I have created a bar chart and made several copies of it within a worksheet, it will only be the original and not the copies that are affected by this. If anyone can shed any light on why this may be happening and how it could be fixed, I would really appreciate it. Lucie ...

Get the file path from Textbox
hello i want to get the path of file from textbox and then attach it to already opened window(it would be a Plugin)i am unable to get is it possible i give file path in Textbox and on clicking a button on form say "Attach it",it attacch file on mail window? thanks -adnan -- Message posted via http://www.officekb.com ...

Linking a cell to a chart title
How do I link a chart title to a cell reference in another worksheet? I have over 200 graphs in one spreadsheet and need a quick way to update the titles when mgmt changes for each sales team. ...

How do I use a pivot table to get an average count? #2
I have a list of transactions with colum headers of Month, Date, Weekday, Time and the transaction data. I would like to see the average number of transaction per hour per day. Can this be done in a pivot table? ...

chart with actuals and limits
How can I create a line chart that shows actuals and upper and lower limits? For example, tracking a persons Triglyceride. The range is (low) 30 and (High) 149 and actuals are 146, 122, 139, 125, 116, 99, 99, 112. Simplest way, set up your data like this: Low Actual High 30 146 149 30 122 149 30 139 149 30 125 149 30 116 149 30 99 149 30 99 149 30 112 149 select this range and create your chart. If you have specific X values or category labels, insert a column before Low and put them there, don't put a column header (the ce...

continually getting send/receive errors using outlook 2002
Does anyone know why I am continually getting send/receive errors when trying to send an e-mail. I can receive e-mails from virtually anybody that is not blocked by Norton Anti-Spam(Norton Internet Security 2005). My account is a pop3 account with the 'Orange' mobile phone network, therefore it has an '@orange.net' address. I have tried 'repairing' outlook from add/remove programs - this did not fix the problem. Neither did uninstalling and re-installing (also from add/remove programs) this time it only allowed me to send a test e-mail to my '@aol.com' ad...

Intercompany in PO receiving in GP 9.0
Hi all, I have a requirement to do intercompany disctibution during receiving process in "Receiving transaction entry". How do I achieve it with GP 9.0 Thanks Ramesh, The GP Intercompany module cannot do this. However, I think that MC2's Advanced Intercompany Transactions product can: http://www.mc2software.com/AITComparison.aspx. -- Victoria Yudin Dynamics GP MVP Flexible Solutions - home of GP Reports http://www.flex-solutions.com/gpreports.html "Ramesh" <Ramesh@discussions.microsoft.com> wrote in message news:F082D83C-789A-41B7-A3CA-579425E2952B@m...

Chart ticker
hi, I'm having a problem trying to move the tickers to the bottom of the chart when I have negative values. I am able to move the scale down but the tickers are still at the top of the chart. I was just wondering if someone can enlighten me with their knowledge. Thanks. Kevin Hi, If by tickers you mean labels then set the Tick mark labels to low on the Patterns tab of the format axis dialog. http://www.andypope.info/tips/tip002.htm Cheers Andy chewymeeh wrote: > hi, > > I'm having a problem trying to move the tickers to the bottom of the > chart when I have neg...

Getting a chart on the web
Hi folks, I am hoping someone out there might be able to help me or give me some advice. Here is what i am trying to do. I have a list on a Sharepoint site with numeric data i want to show graphically. Now i can create the chart in excel via a web query when i export the list. As the data on the list changes, refreshing the book changes. But what i need to do is get the chart on the site, linked to the date, dynamiclly refreshed, linked to the list with the data. Any advice on the cleanest way to do it? thanks ben ...

Help with VC6.0 Basic Concept!
Hello everyone, I am new to VC,and I don't quit understand the defferences in project types in vc6.0, especially MFC AppWizard, Win32 Application, Win32 Console Application, Win32 Dynamic-Link Libray, MFC AppWizard and Win32 Static Libary,Thanks very much! Lazytiger wrote: > Hello everyone, > I am new to VC,and I don't quit understand the defferences in project > types in vc6.0, especially MFC AppWizard, Win32 Application, Win32 Console > Application, Win32 Dynamic-Link Libray, MFC AppWizard and Win32 Static > Libary,Thanks very much! A console applic...