Does Microsoft Office primary interactions (PIA) need to be installed on a computer

Does Microsoft Office Primary Interaction (PIA) require a job to be installed on the computer?

I have gone through so many confusing posts / sites and have not been able to come to a conclusion.

I have a machine where office is not installed and I am using VS2010. Because the assembly Microsoft.Office.Interop.Excel was not available in the COM section in the link. I am adding it via the .Net section in links. However, it throws the following error.

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

This approval from the Mircosoft website, Office PIA is not required on end user computers to run Office solutions . What does it mean?

Does this mean that without installing Office we can work with interop assemblies?

If not, why do we require a PIA when an office needs to be installed to make things work?

+3


source to share


3 answers


Does Microsoft Office Primary Interaction (PIA) require a job to be installed on the computer?

Yes.



PIAs are simply assemblies that allow you to invoke the Office COM object model from .NET. This requires the presence of COM objects that are hosted in Office applications. You did not receive a logged class error because a COM object is missing on the computer. To fix the fact that you need to install the version of Office, your application is designed to work.

+5


source


This approval from the Mircosoft website, Office PIA is not required on end user computers to run Office solutions. What does it mean?

This is not the current quote I am finding. I find this:

PIAs must also be installed on end-user computers to run Office solutions that target the .NET Framework 3.5. However, the Office PIA is not required on end-user computers to run Office solutions that target the .NET Framework 4. For more information, see Designing and Building Office Solutions. ( https://msdn.microsoft.com/en-us/library/vstudio/hy7c6z9k(v=vs.100).aspx )

This means (for 4+ network) that when building an Office solution in VS usint PIAs, you do not need to install those PIAs on the target computer to be able to run the solution. (the reason is if you are targeting Net4, if the Embed Interop Types property for each PIA Office reference in the project is set to True (this is the default), the type information for the PIA types your solution is using is embedded in the solution assembly when assembly of the project. At run time, the built-in type information is used instead of the PIA to be called in the object model of the Office application on COM. For more information on how types from the PIA are injected into your solution ( https://msdn.microsoft.com/en -us / library / vstudio / 3295w01c (v = vs.100) .aspx )

For example: I want to write a program in VB to do something on an XLSX sheet.



I need to install Excel, PIA and VS on my development machine, otherwise I won't be able to write it.

Once this program is complete, I want Bob in accounting to run it. So I publish the program and it gets installed on Bob's machine. Bob does not need to install PIA on his local machine to run the program. He will need an office.

Does this mean that without installing Office we can work with interop assemblies?

And vice versa. This means Net 4+ applications using PIA (EIT), your application can run without PIAs installed on the client machine (the required parts will be part of your deployment).

+4


source


There are really two parts to your question:

  • What is developer need to develop an application that uses Office components?
  • What is required for an end user to run this application?

The MSDN article Overview of Office Development (Visual Studio 2013) provides quick guidance on these issues. In the section "Automating Office Applications Using Primary Assemblies":

You must have Office PIA installed and registered on the WAN build cache on your development machine to complete most development tasks. For more information, see Setting up a computer for developing office solutions . Office PIAs are not required for end-user computers to run Office solutions. For more information, see Designing and Building Office Solutions .

The first article reveals that a developer must install Microsoft Office:

To create add-ins and customizations for Microsoft Office, install a supported version of Visual Studio, .NET Framework, and Microsoft Office.

And from the last article under "Understanding When Office PIAs Are Needed for End User Computers":

By default, Office Primary Assemblies (PIAs) should not be installed on end-user computers if the Insert Types of Interaction property of each link in the Office PIA in the project is set to True , which is the default. In this case, the type information for the PIA types that your solution uses is built into the solution assembly when you create the project. At startup time, the built-in type information is used instead of the PIA to call the Office COM application into the application object model. For more information on how types from the PIA are built into your solution, see Equivalence Types and Built-in Interaction Types .

+1


source







All Articles