Click here to Skip to main content
16,018,394 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to unload an assembly? Pin
Paul Conrad28-Jul-08 19:58
professionalPaul Conrad28-Jul-08 19:58 
GeneralRe: How to unload an assembly? Pin
amit.jha28-Jul-08 20:08
amit.jha28-Jul-08 20:08 
GeneralRe: How to unload an assembly? Pin
Christian Flutcher28-Jul-08 20:25
Christian Flutcher28-Jul-08 20:25 
GeneralRe: How to unload an assembly? Pin
amit.jha28-Jul-08 20:50
amit.jha28-Jul-08 20:50 
GeneralRe: How to unload an assembly? Pin
satyaanand.andra@gmail.com28-Jul-08 20:35
satyaanand.andra@gmail.com28-Jul-08 20:35 
GeneralRe: How to unload an assembly? Pin
amit.jha28-Jul-08 20:53
amit.jha28-Jul-08 20:53 
GeneralRe: How to unload an assembly? Pin
satyaanand.andra@gmail.com28-Jul-08 23:18
satyaanand.andra@gmail.com28-Jul-08 23:18 
QuestionERROR : Exception from HRESULT: 0x800A03EC Pin
varshavmane28-Jul-08 19:53
varshavmane28-Jul-08 19:53 
Hello All,

I am using ASP.NET 2005(C#). I want to show and save the excel file on server. For this I opened excel file in iframe and kept a save button outside the iframe. On Page Load I have the following code:

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            try
            {
                string fileName = AppDomain.CurrentDomain.BaseDirectory + "SaveExcelFile\\Excel1.xls";
                Microsoft.Office.Interop.Excel.Application ObjExcel = new Microsoft.Office.Interop.Excel.Application();
                Microsoft.Office.Interop.Excel.Workbook ObjWB;
                Microsoft.Office.Interop.Excel.Worksheet ObjWS;
                Object missing = System.Reflection.Missing.Value;
                if (ObjExcel == null)
                {
                    //'throw an exception
                    throw (new Exception("Unable to Start Microsoft Excel"));
                }
                else
                {
                    ObjExcel.Visible = true;
                    ObjExcel.DisplayAlerts = false;
                    ObjWB = ObjExcel.Workbooks._Open(fileName, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing);
                    ObjWS = (Microsoft.Office.Interop.Excel.Worksheet)ObjWB.ActiveSheet;
                    Session["ExcelObject"] = ObjExcel;
                    Session["WorkBook"] = ObjWB;
                    Session["WorkSheet"] = ObjWS;
                    htxtFileName.Value = "SaveExcelFile/Excel1.xls";
                }
            }
            catch (Exception ex)
            {
                Response.Write("Page Load Error : " + ex.Message);
            }
        }
    }



and On Save Button Click event I have the following code:


protected void btnSaveFileToServer_Click(object sender, EventArgs e)
    {
        try
        {
            if (Session["ExcelObject"] != null && Session["WorkBook"] != null && Session["WorkSheet"] != null)
            {
                Microsoft.Office.Interop.Excel.Application ObjExcel = (Microsoft.Office.Interop.Excel.Application)Session["ExcelObject"];
                Microsoft.Office.Interop.Excel.Workbook ObjWB = (Microsoft.Office.Interop.Excel.Workbook)Session["WorkBook"];
                Microsoft.Office.Interop.Excel.Worksheet ObjWS = (Microsoft.Office.Interop.Excel.Worksheet)Session["WorkSheet"];
                ObjExcel.ThisWorkbook.Save();
            }
        }
        catch (Exception ex)
        {
            Response.Write("ERROR : " + ex.Message);
        }
    }


The above code works fine on my machine but when I deploy it on server it gives error "ERROR : Exception from HRESULT: 0x800A03EC" while saving the file back to server.

Please help me.

Thanks in advance.
AnswerRe: ERROR : Exception from HRESULT: 0x800A03EC Pin
Paul Conrad28-Jul-08 19:58
professionalPaul Conrad28-Jul-08 19:58 
GeneralRe: ERROR : Exception from HRESULT: 0x800A03EC Pin
varshavmane28-Jul-08 20:08
varshavmane28-Jul-08 20:08 
GeneralRe: ERROR : Exception from HRESULT: 0x800A03EC Pin
Paul Conrad28-Jul-08 20:15
professionalPaul Conrad28-Jul-08 20:15 
AnswerRe: ERROR : Exception from HRESULT: 0x800A03EC Pin
Paul Conrad28-Jul-08 20:17
professionalPaul Conrad28-Jul-08 20:17 
GeneralRe: ERROR : Exception from HRESULT: 0x800A03EC Pin
varshavmane28-Jul-08 20:23
varshavmane28-Jul-08 20:23 
GeneralRe: ERROR : Exception from HRESULT: 0x800A03EC Pin
Paul Conrad28-Jul-08 20:25
professionalPaul Conrad28-Jul-08 20:25 
GeneralRe: ERROR : Exception from HRESULT: 0x800A03EC Pin
varshavmane28-Jul-08 20:29
varshavmane28-Jul-08 20:29 
GeneralRe: ERROR : Exception from HRESULT: 0x800A03EC Pin
OleHansen21-Jul-09 21:44
OleHansen21-Jul-09 21:44 
AnswerRe: ERROR : Exception from HRESULT: 0x800A03EC Pin
priya_velan19-Oct-10 15:30
priya_velan19-Oct-10 15:30 
Questionvs2003 setup Pin
Kissy1628-Jul-08 19:40
Kissy1628-Jul-08 19:40 
AnswerRe: vs2003 setup Pin
Paul Conrad28-Jul-08 19:59
professionalPaul Conrad28-Jul-08 19:59 
GeneralRe: vs2003 setup Pin
Kissy1628-Jul-08 20:20
Kissy1628-Jul-08 20:20 
GeneralRe: vs2003 setup Pin
Paul Conrad28-Jul-08 20:24
professionalPaul Conrad28-Jul-08 20:24 
QuestionSystem.Net.WebException--The underlying connection was closed: Pin
pubududilena28-Jul-08 19:28
pubududilena28-Jul-08 19:28 
Questionupdate progree bar in modal popup Pin
Member 387988128-Jul-08 19:24
Member 387988128-Jul-08 19:24 
AnswerRe: update progree bar in modal popup Pin
Christian Graus28-Jul-08 20:10
protectorChristian Graus28-Jul-08 20:10 
Questionhow import print option in Report viewer Pin
Guvera28-Jul-08 18:48
Guvera28-Jul-08 18:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.