Primary Interop Assemblies

Office applications such as Excel and Word are written in unmanaged code.
The primary interop assemblies are the corresponding runtime callable wrappers for the Microsoft Office applications.
The only way .NET code can interoperate with the unmanaged Office COM objects is via the Interop Assemblies.
The Microsoft Office Primary Interop assemblies are the interop assemblies that you need to reference and use.
When you are adding references to PIAs from within your project you should use the .NET tab.
It is possible to create your own wrappers for COM Object Models using tlbimp.exe.
An interop assembly is a managed .NET equivalent of a COM type library.
An Interop Assembly that is distributed by the owner of the original COM server is called a primary interop assembly (PIA).
Primary Interop Assemblies are always digitally signed by the publisher of the original unmanaged assembly.



Microsoft.Office.Interop.Excel

This namespace needs to be referenced in your code

using Excel = Microsoft.Office.Interop.Excel; 




Embedded PIAs

Visual Studio 2010 (C# v4.0) provided the ability to embed interop types.
The PIAs are embedded by default
These can be embedded into your assembly so that you don't have to deploy them alongside your solution.
There is an "Embed Interop Type" property associated with each interop reference assembly.
If you embed type information you eliminate the need for a primary interop assembly
If the "Embed Interop Type" property is set to False, you must include the PIA for each version of Office that the application will run with.




Visual Studio Common Interop Assemblies

When you install Visual Studio, the PIAs are automatically installed into the Visual Studio folder on the C drive.
When you create a new project, references are automatically added to refer to the PIAs on the C drive.
The Visual Studio PIA files are installed in the following directory:

C:\Program Files\ Microsoft Visual Studio 10.0 \ Visual Studio Tools for Office \ PIA \ Common \ 
C:\Program Files\ Microsoft Visual Studio 10.0 \ Visual Studio Tools for Office \ PIA \ Office12 \
C:\Program Files\ Microsoft Visual Studio 10.0 \ Visual Studio Tools for Office \ PIA \ Office14 \



NameNotes
Microsoft Visual Basic for Applications Extensibility 5.3Provides objects for working with the Visual Basic Editor
C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB
stdoleProvides basic COM types as well as the IPictureDisp data type
Can also be found in the following location:
C:\Program Files\Microsoft.NET\Primary Interop Assemblies\
C:\Program Files\Common Files\Microsoft Shared\MsEnv\PublicAssemblies\
C:\Program Files\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Common\
MSCOMCTL 
Extensibility (for Visual Studio)This provides the IDTExtensibility2 interface and this is included because it is possible to create add-ins for Visual Studio itself.
C:\Program Files\Common Files\Microsoft Shared\MSEnv\PublicAssemblies\Extensibility.dll


Office 2016 Interop Assemblies



Office 2013 Interop Assemblies

These PIAs are deployed with Office and should not be installed manually.

Microsoft Office 15.0 Object Library[Office]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Visual Studio Tools for Office\PIA\Office15\Office.dll
Microsoft Excel 15.0 Object Library[Microsoft.Office.Interop.Excel]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Visual Studio Tools for Office\PIA\Office15\
Microsoft Word 15.0 Object Library[Microsoft.Office.Interop.Word]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Visual Studio Tools for Office\PIA\Office15\
Microsoft PowerPoint 15.0 Object Library[Microsoft.Office.Interop.PowerPoint]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Visual Studio Tools for Office\PIA\Office15\
Microsoft Outlook 15.0 Object Library[Microsoft.Office.Interop.Outlook]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Visual Studio Tools for Office\PIA\Office15\


Office 2010 Interop Assemblies

These PIAs are deployed with Office and should not be installed manually.

Microsoft Office 14.0 Object Library[Office]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Visual Studio Tools for Office\PIA\Office14\Office.dll
Microsoft Excel 14.0 Object Library[Microsoft.Office.Interop.Excel]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Visual Studio Tools for Office\PIA\Office14\
Microsoft Word 14.0 Object Library[Microsoft.Office.Interop.Word]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Visual Studio Tools for Office\PIA\Office14\
Microsoft PowerPoint 14.0 Object Library[Microsoft.Office.Interop.PowerPoint]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Visual Studio Tools for Office\PIA\Office14\
Microsoft Outlook 14.0 Object Library[Microsoft.Office.Interop.Outlook]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Visual Studio Tools for Office\PIA\Office14\


Office 2007 Interop Assemblies

These PIAs are deployed with Office and should not be installed manually.

Microsoft Office 12.0 Object Library[Microsoft.Office.Core]C:\Program Files\Common Files\Microsoft Shared\Office12\mso.dll
Microsoft Excel 12.0 Object Library[Microsoft.Office.Interop.Excel]
Microsoft Word 12.0 Object Library[Microsoft.Office.Interop.Word]
Microsoft PowerPoint 12.0 Object Library[Microsoft.Office.Interop.PowerPoint]
Microsoft Outlook 12.0 Object Library[Microsoft.Office.Interop.Outlook]

© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

Top

PrevNext