A
Avinash avicool08
Hi
I have a code like follows.....I am using Windows 2000 server.....to
generate excel template....and i am getting the following error....
=====================================
Exception Type: System.Runtime.InteropServices.COMException
Exception: The remote procedure call failed. (Exception from HRESULT:
0x800706BE)
Source: createtemplate
Page Name:systemdefaults_aspx
Stack Trace:
at Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs(Object Filename,
Object FileFormat, Object Password, Object WriteResPassword, Object
ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode,
Object ConflictResolution, Object AddToMru, Object TextCodepage, Object
TextVisualLayout, Object Local)
at SystemDefaults.createtemplate()
======================================
Exception Type: System.Runtime.InteropServices.COMException
Exception: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
Source: Application_Error
Page Name:Global.asax
Stack Trace:
at Microsoft.Office.Interop.Excel.ApplicationClass.get_Workbooks()
at SystemDefaults.createtemplate()
at SystemDefaults.GenerateExl_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e)
at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String
eventArgument)
at
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
===============================================
code as follow.....
.........
.......
excelWorkBook.SaveAs(Server.MapPath("Template/" + version), Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing);
excelWorkSheet.Protect(password, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing);
excelWorkBook.Save();
excelApplication.Quit();
======================================================
any solution?
I have a code like follows.....I am using Windows 2000 server.....to
generate excel template....and i am getting the following error....
=====================================
Exception Type: System.Runtime.InteropServices.COMException
Exception: The remote procedure call failed. (Exception from HRESULT:
0x800706BE)
Source: createtemplate
Page Name:systemdefaults_aspx
Stack Trace:
at Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs(Object Filename,
Object FileFormat, Object Password, Object WriteResPassword, Object
ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode,
Object ConflictResolution, Object AddToMru, Object TextCodepage, Object
TextVisualLayout, Object Local)
at SystemDefaults.createtemplate()
======================================
Exception Type: System.Runtime.InteropServices.COMException
Exception: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
Source: Application_Error
Page Name:Global.asax
Stack Trace:
at Microsoft.Office.Interop.Excel.ApplicationClass.get_Workbooks()
at SystemDefaults.createtemplate()
at SystemDefaults.GenerateExl_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e)
at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String
eventArgument)
at
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
===============================================
code as follow.....
.........
.......
excelWorkBook.SaveAs(Server.MapPath("Template/" + version), Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing);
excelWorkSheet.Protect(password, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing);
excelWorkBook.Save();
excelApplication.Quit();
======================================================
any solution?