Microsoft.Office.Interop.Excel.ListObject vs Microsoft.Office.Tools.Excel.ListObject
I need to access the Selected Event of all the listobjects in all the worksheets of my workbook but when I access worksheet.listobject, that object appar开发者_如何学运维ently belongs to Microsoft.Office.Interop.Excel.ListObject and so doesn't have any events where as the table list object belongs to Microsoft.Office.Tools.Excel.ListObject.
And I read that Microsoft.Office.Tools.Excel.ListObject.InnerObject = Microsoft.Office.Interop.Excel.ListObject
but i don't know how to use it.
Pls Help
Thanks, Kavita
I think that you must use Microsoft.Office.Tools.Excel.ListObject.GetVstoObject(lstObj) where lstObj is a Microsoft.Office.Interop.Excel.ListObject to get the correct object. And it's only available with at Application-level Addin, not at Document-Level, you can read the documentation. From: MSDN info. And now you have also a ListObjectExtensions
More info about the events of Tools.Excel.ListObject at: MSDN Events
精彩评论