开发者

Excel Interop fails when I open the Excel applicaion manually! Why?

I have a c# application that uses Microsoft.Office.Interop.Excel. The ap开发者_如何学Goplication runs for a long period of time! If I try to open Excel manually on a different worksheet from the one the c# application is processing the c# application fails with some HResult cryptic message.

Is there a limitation with Microsoft.Office.Interop.Excel in that only 1 excel process can run at once?

Any information around this issue would be great!

thanks for any help!


Mostly, it is how your code is interacting with Excel that is the problem. Many people use ActiveCell, ActiveWorkbook, and so on. Therefore, when you open another workbook during this process, you will generate some kind of error. To avoid this, open another instance of Excel. In our shop, we created a shortcut in our "Send To..." folder. We could then just right-click on the file in Windows Explorer, select "Send To..." menu, then click on our shortcut. This saved us from having to open Excel, select file open, browse to file, and so on.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜