开发者

Marshal.GetActiveObject() problem

I am using

Microsoft.Office.Interop.Excel.Application oExcelApp = 
                     (Microsoft.Office.Interop.Excel.Application)Marshal.GetActiveObject开发者_StackOverflow("Excel.Application");

in my project. It gives me an error when there is no Excel file open at the moment. How can I check to see if there is no Excel file running?


Here is approach of using Marshal.GetActiveObject and how to handle situation if object not found. Hope this will help.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜