How to access Excel.ActiveWorkbook.Model.ModelTables by C#

Add-in Express™ Support Service
That's what is more important than anything else

How to access Excel.ActiveWorkbook.Model.ModelTables by C#
 
ke sun




Posts: 3
Joined: 2020-11-29
I can use ActiveWorkbook.Model.ModelTables.Count in VBA,but I can't find the property Model in ADX COM ADDIN project by C#.Why?
Posted 31 Dec, 2020 03:28:44 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Ke,

This depends on the interop assembly used in your add-in: that property is available in Excel 2013+. If your add-in must support an earlier Excel version(s), you access that property using late binding; here's search query for the InvokeMember() call (it stands behind "late binding" calls) on our forums: http://www.add-in-express.com/forum/search.php?tags=&q=InvokeMember&where=5.


Andrei Smolin
Add-in Express Team Leader
Posted 04 Jan, 2021 09:33:30 Top
ke sun




Posts: 3
Joined: 2020-11-29
Thank you.I choosed "support 2010" as I created the solution.Can I change it in the existed solution?
Posted 06 Jan, 2021 05:23:43 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Ke,

To specify what Office versions are supported, you set the minOfficeVersionSupported attribute; see Loader manifest. Say, you set it to 14 meaning the add-in will load in Office 2010-2019/365 and won't load in Office 2000-2003. Omitting this attribute causes your add-in to load in any Office version from 2000 to the latest.

If you change the minOfficeVersionSupported attribute, you may need to use different interops: copy the required interops from {Add-in Express Installation folder}\Redistributables\Interops Assemblies to the Interops folder of your project. You may need to add references to the new interops.


Andrei Smolin
Add-in Express Team Leader
Posted 08 Jan, 2021 01:47:17 Top
ke sun




Posts: 3
Joined: 2020-11-29
OK,thank you!
Posted 08 Jan, 2021 02:47:41 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
You are welcome!


Andrei Smolin
Add-in Express Team Leader
Posted 08 Jan, 2021 03:41:27 Top