在本机上可以导出,换其他机子就报错!!操作Excel用的是引用COM组件的方法.估计是Excel版本问题,但是在相同版本的机子上测试,还是报错!!望,高手指点!!

解决方案 »

  1.   

    报的错是:System.IO.FileNotFoundException: Could not load file or assembly 'Interop.Excel, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
    File name: 'Interop.Excel, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null'
      

  2.   

    如果你没打包,拷到其它电脑运行,记得连Bin目录里的Interop.Excel.dll,Interop.office.dll,一起拷过去了.有这两个Com文件,不需要Excel环境的支持.
      

  3.   

    拷过了,也可以导出Excel,但是导出来的Excel 不能读取!是一张空表.在本机上,是有数据的
      

  4.   

    试了两台机子  有一台照 "ydsunny(小强)" 的做法正确   有一台还是不对.结帖!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!