开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜