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.
精彩评论