【发布时间】:2011-12-12 17:54:27
【问题描述】:
我正在使用 Excel 12 Interop 用 C# 编写程序,当我在安装了 Microsoft Office 2003 的 windows xp 机器上运行程序时,它会引发 HRESULT 0x800A03EC 异常。
我的开发机器有 Windows 7 64bit 和 Microsoft Office 2007,程序运行良好。
我的另存为代码是这样的:
wbk.SaveAs(path, Excel.XlFileFormat.xlExcel8,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Excel.XlSaveAsAccessMode.xlExclusive,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing,
Type.Missing);
是否有任何变通方法可供我使用,这样我就不必在运行 Windows XP 的机器上安装 Office 2007?
更新
我已经在同样是 64 位的 Windows XP 机器上安装了 Office 2007 和 Office 2010 的互操作程序集,但我仍然收到同样的错误。会不会是程序集的权限问题?
【问题讨论】:
-
我在 Windows XP x64 上收到此错误,而不是在 Windows 7 上。
-
这是一个 Excel 错误,而不是 Windows 错误。当你用谷歌搜索“excel saveas error 1004”时,会有更多的点击。您的问题中没有足够的信息来帮助我们帮助您缩小范围。
标签: c# excel com-interop