System.Runtime.InteropServices.COMException (0x800A03EC)

后端 未结 7 1230
梦谈多话
梦谈多话 2020-11-29 02:07

Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs() method is working fine on Windows server 2003 and also on XP but not on Windows server 2008. I copied it a

7条回答
  •  [愿得一人]
    2020-11-29 02:38

    I was seeing this same error when trying to save an excel file. The code worked fine when I was using MS Office 2003, but after upgrading to MS Office 2007 I started seeing this. It would happen anytime I tried to save an Excel file to a server or remote fie share.

    My solution, though rudimentary, worked well. I just had the program save the file locally, like to the user's C:\ drive. Then use the "System.IO.File.Copy(File, Destination, Overwrite)" method to move the file to the server. Then you can delete the file on the C:\ drive.

    Works great, and simple. But admittedly not the most elegant approach.

    Hope this helps! I was having a ton of trouble finding any solutions on the web till this idea popped into my head.

提交回复
热议问题