Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am writing an excel Add which will fetch data from database. I am able to add the custom menu to excel in OnConnection Extensibility.IDTExtensibility2, but after that the Excel Object is destroyed and I am not able to access the Active Workbook.

How to access the excel workbook that is active?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
306 views
Welcome To Ask or Share your Answers For Others

1 Answer

1>((Microsoft.Office.Interop.Excel.Application)Marshal.GetActiveObject("Excel.Application").ActiveWorkBook
2>You can check my answer here to get handle to excel application object Get the excel cell address from a UDF


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...