View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Avinash [email protected] Avinash avicool08@gmail.com is offline
external usenet poster
 
Posts: 1
Default 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?