Midhun Murali Midhun Murali - 18 days ago 11
C# Question

Does Primary Interop Assemblies ( PIA ) require Microsoft Office to be installed in the machine to work

Does Primary Interop Assemblies ( PIA ) require Microsoft Office to be installed in the machine to work ?

I have gone through so many confusing post/sites and unable arrivie at a conclusion.

I have a machine where office is not installed and I am using VS2010 . As Microsoft.Office.Interop.Excel assembly was not avaialble in COM section in referance . I add it through thought .Net section in referances . Still it throws the below error .


Retrieving the COM class factory for component with CLSID failed due
to the following error: 80040154 Class not registered (Exception from
HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))


This is statement from Mircosoft website , The Office PIAs are not required on end-user computers to run Office solutions . What does this mean exactly ?

Does it mean without Office installation we can work with interop assemblies ?

If not why we require PIA when office needs to be installed to get things work ?

Answer

Does Primary Interop Assemblies ( PIA ) require Microsoft Office to be installed in the machine to work ?

Yes.

The PIA are simply assemblies that allow you to call the Office COM object model from .NET. The COM objects which are hosted by the Office applications still need to be present for this to work. The Class not registered error you get is because the COM object is missing on the computer. To fix that you need to install the version of Office your application is designed to work with.