开发者

How to "link" to an already open Excel.Application with Interop c#

开发者 https://www.devze.com 2023-04-09 13:08 出处:网络
I can create an instance of Excel using: Microsoft.Office.Interop.Excel.Application gXlApp = new Microsoft.Office.Interop.Excel.Application();

I can create an instance of Excel using:

Microsoft.Office.Interop.Excel.Application gXlApp = new Microsoft.Office.Interop.Excel.Application();
        gXlWb= gXlApp.Workbooks.Add(Missing.Value);
        gXlApp.Visible 开发者_JAVA百科= true;
        gXlApp.DisplayAlerts = false;

BUT is there a way to "point" gXlApp at an instance of Excel that is already open?

Currently I have to start Excel from c# then open the workbook and run my code.

0

精彩评论

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