p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 26th, 2008, 08:20 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error 'Exception from HRESULT: 0x800A03EC'

Hi All,

In one the intranet sites which I have developed, i'm creating an excel file from C#.Net 2005-ASP.NET 2.0

application. In my local machine which runs on Windows XP the application works perfectly, but when I try to run

the application in windows 2008 server machine it throws an exception.

'Exception from HRESULT: 0x800A03EC'

What is running in the windows 2008 server machine is the published version of my application. I have all the

required dlls and other application dependency files in the bin folder including Interop.Excel.dll and

Interop.Microsoft.Office.Core.dll.

The windows 2008 server machine has MS Office 2003 version installed. I have also configured DCOM in this machine.

Here is my code

            string fileName = "", strSaveFileAs = "";//To Save the File Name of the Excel File
            ItemMaster itemInfo;
            Excel.Application xlApp = new Excel.Application();//initialise Xl app
            Excel.Workbook xlWorkBook = xlApp.Workbooks.Add(true);
            object worksheet = xlWorkBook.ActiveSheet;// set work sheet
            object objMissing = System.Reflection.Missing.Value;
            if (arList.Count > 0)
            {
                ((Excel.Worksheet)xlApp.ActiveSheet).Cells[1,1] = "SINO";
                ((Excel.Worksheet)xlApp.ActiveSheet).Cells[1, 2] = "ItemGroupName";
                ((Excel.Worksheet)xlApp.ActiveSheet).Cells[1, 3] = "ItemCode";
                ((Excel.Worksheet)xlApp.ActiveSheet).Cells[1, 4] = "ItemName";
                ((Excel.Worksheet)xlApp.ActiveSheet).Cells[1, 5] = "QTY";
                ((Excel.Worksheet)xlApp.ActiveSheet).Cells[1, 6] = "Rate";

                int SINo = 0;// To Show Serial No in excel.
                for (int iRows = 1; iRows <= arList.Count; iRows++)
                {
                    itemInfo = new ItemMaster();
                    itemInfo = (ItemMaster)arList[SINo];
                    ((Excel.Worksheet)xlApp.ActiveSheet).Cells[iRows + 1, 1] = (SINo + 1).ToString();
                    //Here GroupId actually contains group name
                    ((Excel.Worksheet)xlApp.ActiveSheet).Cells[iRows + 1, 2] = itemInfo.GroupID.ToString();
                    ((Excel.Worksheet)xlApp.ActiveSheet).Cells[iRows + 1, 3] = itemInfo.ItemCode.ToString();
                    ((Excel.Worksheet)xlApp.ActiveSheet).Cells[iRows + 1, 4] = itemInfo.ItemName.ToString();
                    ((Excel.Worksheet)xlApp.ActiveSheet).Cells[iRows + 1, 5] = "";
                    ((Excel.Worksheet)xlApp.ActiveSheet).Cells[iRows + 1, 6] = itemInfo.Rate.ToString();
                    ((Excel.Worksheet)xlApp.ActiveSheet).Cells[iRows + 1, 7] = "";
                    ((Excel.Worksheet)worksheet).Columns.AutoFit(); //format
                    xlApp.ScreenUpdating = true;
                    SINo++;
                }
                /* FileName format of xls is: QuoteNo_CustomerName_Date*/
                strSaveFileAs = txtCode.Text + "_" + ddlCustomer.SelectedItem.ToString() + "_" + txtDate.Text;


                string filePath = Server.MapPath("..//Sales//Quote/");
                fileName = filePath + "QuoteFile" + ".xls";
                if (File.Exists(fileName))
                    File.Delete(fileName);
                  //Save file in the Location 'fileName'
                xlWorkBook.SaveAs((object)(fileName), objMissing, objMissing, objMissing, objMissing, objMissing,

Excel.XlSaveAsAccessMode.xlNoChange, objMissing, objMissing, objMissing, objMissing, objMissing);

"Exception from HRESULT: 0x800A03EC" exception is thrown when the line of code

xlWorkBook.SaveAs((object)(fileName), objMissing, objMissing, objMissing, objMissing, objMissing, Excel.XlSaveAsAccessMode.xlNoChange, objMissing, objMissing, objMissing, objMissing, objMissing); is executed.

Looking forward to hear from you soon.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old November 27th, 2008, 04:56 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the exact error i'm getting is System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old March 12th, 2009, 06:17 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am having a similar problem... did you ever find the solution to this
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old November 6th, 2009, 09:17 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default HRESULT: 0x800A03EC

I came here trying to find an answer. Finding none I went back to my code. I discovered that I was attempting to reference a cell with a 0 in the column parameter. For example mySheet.Cells[1,0]. When I fixed that it ran OK.

Hope this helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Needhelp Error- Exception from HRESULT: 0x800A0057 remya1000 General .NET 1 November 6th, 2008 11:45 AM
Exception from HRESULT: 0x800A03EC adorable.ashish General .NET 0 February 18th, 2008 06:33 AM
access denied. [exception from HRESULT: 0x80070005 p2ptolu Internet Information Services 0 December 18th, 2007 02:58 PM
Exception from HRESULT : 0x800A2740. remya1000 .NET Framework 1.x 0 November 8th, 2007 04:29 PM
Exception from HRESULT: 0x80131524. kschori Crystal Reports 0 May 7th, 2004 04:27 PM



All times are GMT -4. The time now is 07:22 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc