ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   The remote procedure call failed. (Exception from HRESULT: 0x80070 (https://www.excelbanter.com/excel-worksheet-functions/214410-remote-procedure-call-failed-exception-hresult-0x80070.html)

Avinash [email protected]

The remote procedure call failed. (Exception from HRESULT: 0x80070
 
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.SaveA s(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.ge t_Workbooks()
at SystemDefaults.createtemplate()
at SystemDefaults.GenerateExl_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.LinkButton.OnClick(Event Args e)
at System.Web.UI.WebControls.LinkButton.RaisePostBack Event(String
eventArgument)
at
System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection 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?










All times are GMT +1. The time now is 08:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com