【发布时间】:2012-06-15 17:37:00
【问题描述】:
我正在为 Autodesk Inventor 构建 C# 插件。这是相关的唯一原因是因为我必须取消选中“注册 COM 互操作”框。
这是我正在使用的。 xls 始终位于代码运行所在的同一目录中。我也尝试过使用绝对路径,但我得到了同样的错误。 bool 仅用于测试,但它返回 true。该文件不是只读的。
bool fileExists = File.Exists ("Assembly3.xls");
xlBook = xlApp.Workbooks.Open ("Assembly3.xls");
我收到的错误消息:https://dl.dropbox.com/u/46698764/cantFindFile.png 既然它说 COMException,我想我的问题可能是因为我未选中“注册 COM 互操作”框。如果是这种情况,有人可以推荐另一种打开工作簿的方法吗?
如果重要的话,我有 Excel 2010。
【问题讨论】:
标签: c# excel comexception