解决方案 »

  1.   

    不明白楼主什么意思?不连接服务器,你怎么导出服务器上的excel?
      

  2.   

    try this:
    http://www.cnblogs.com/insus/articles/1400266.html
      

  3.   

    workbook.SaveCopyAs("C:\\Users\\Public\\Documents\\HiFastdata.xls");  //把EXCEL保存到了服务器

    filePath = "C:\\Users\\Public\\Documents\\HiFastdata.xls";
    FileStream fs = new FileStream(filePath, FileMode.Open);   //打开服务器端EXCEL

    HttpContext.Current.Response.BinaryWrite(bytes);
    HttpContext.Current.Response.Flush();
    HttpContext.Current.Response.End();   //导出EXCEL到客户端本地在这个过程中,需要要在调试的本地电脑上先远程连接服务器,这样才能保证EXCEL成功保存到了服务器,如果没有远程连接,这段代码就会报错求高手解决,不甚感谢!!!!!
      

  4.   

    你的B/s 还是C/s的?都要连接服务器啊,即使用服务器数据,也得链接啊!
      

  5.   

    报错信息:
    Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a.
    Source Error: 
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
      

  6.   

    最大的可能是COM组件的权限设定问题。导出EXCEL的话,可以选择使用NOPI组件,可以免去这些操作。直接导出成品的EXCEL到客户端
      

  7.   

    已解决
    是服务器上EXCEL的权限问题
    谢谢大家