I want to get a list of properties of Microsoft.Office.Interop.Excel.Range interface using the following code:
using Excel = Microsoft.Office.Interop.Excel;
PropertyInfo[] info = typeof(Excel.Range).GetProperties();
but the result is an empty array: System.Reflection.PropertyInfo[0]
Am I missing something?
Since VS2010, when importing the Office Primary Interop Assemblies (PIAs), the default mechanism for including the type definitions is to embed them as part of the main assembly instead of as separately referenced libraries (Dll). Part of this embedding process is the removal of unreferenced type members from the embedded definition.
In the Solution Explorer, expand the References node and select
Interop.Microsoft.Office.Interop.Excel
and then )right-click)->Show Properties. You should see something like this:Now when you reflect the managed wrapper interop types, you will get the complete type definition.