C#下的代码:
try
{
  xlsheet.ActiveSheet.Export(Server.MapPath(".") + "/image/" + xlfile.Text,OWC.SheetExportActionEnum.ssExportActionNone);
Response.Write("成功:"+"Excel文件名为");}
catch( System.Runtime.InteropServices.COMException e)
 {
 Response.Write("错误--->" + e.Message);
}

解决方案 »

  1.   

    http://www.ourfly.com/bbs/dispbbs.asp?boardID=12&ID=24
      

  2.   

    代码给孟兄的差不多
    我这里就是
     xlsheet.ActiveSheet.Export(Server.MapPath(".") + "/image/" + xlfile.Text,OWC.SheetExportActionEnum.ssExportActionNone);
    有错,不知道怎么回是
    按我写的总是抛出
    HRESULT 中的异常:0xE004002A。
    这个异常怎么解决呢,等待中.................
      

  3.   

    Server.MapPath(".") + "\Images\" 
    假设在c:\inetpub\wwwroot\yousite\image
    共享这个目录因为OWC.SheetExportActionEnum方法要在制定的目录写入文件
      

  4.   

    c:\inetpub\wwwroot\zzs_test
    其中的zzs_test是项目名称,它的里面有一个image文件夹
    我共享了image文件夹了,还是同样的错误
      

  5.   

    按照:http://www.wimdows.net/articles/printme.aspx?aid=15 的做
      

  6.   

    本来这代码就是 孟兄写的,跟上边的代码一样,可是我按着楼上给的共享,everyone完全控制等,仍然出现同样的异常
    HRESULT 中的异常:0xE004002A
    我这里是office 2000
    不知道是不是因为我环境有问题?
      

  7.   

    xlsheet.get_Range(xlsheet.Cells[1, 1], xlsheet.Cells[1, j + 1]).Font.Bold?????
    C#中怎么设置字体?????????????????
      

  8.   

    跟踪  xlsheet.ActiveSheet.Export(Server.MapPath(".") + "/image/" + xlfile.Text,OWC.SheetExportActionEnum.ssExportActionNone);错误为:
    AutoFilter
    <错误: 发生 {System.Runtime.InteropServices.COMException} 类型的异常> OWC.AutoFilter
      

  9.   

    in Windows Explorer, try to give ASPNET account read/write permissions on the file and the folder it is in
      

  10.   

    把保存EXCEL的文件夹共享一下,使aspnet具有写的权限
    右键----》共享------》"安全"里设置一下