none
Microsoft Office Interop Assemblies RRS feed

  • Question

  • I have a project that uses the Microsoft.Office.Tools.Word.dll. I'm trying to build a setup project but I'm getting "An error occured while validating....". As far as I could establish that is caused by missing a dependency for an assembly. It seems as if the missing reference is a reference to Microsoft.Office.Interop.Word.

     

    It resides in the GAC, how do I add it to my project? 

    Friday, February 8, 2008 7:29 PM

Answers

  • Hi Eengr_Muneer

    <<There is no problem when you add the reference of Microsoft.Office.Interop.Word but the problem is on target machine where the ms-word is not installed.>>

    Word (and any other Office application) must be installed in order to programmatically work with it. The DLLs alone are not enough - they only provide the API, but the actual work is done by the full application.

    Nor are you allowed to distribute any Office application as part of your solution. The Office applications are end-user products and licensed as such. There is no "distributable". When the Office applications are installed, the .NET APIs are installed automatically if the .NET Framework is present. Otherwise your solution has to install the .NET Framework and later the PIAs.


    Cindy Meister, VSTO/Word MVP
    Friday, May 6, 2011 6:40 AM
    Moderator
  • It is a VS2005 problem. I installed VS2008 and upgraded my projects to VS2008 and the problem is no more!

     

    Friday, April 18, 2008 9:41 PM

All replies

  • hello Ockert,

     

    to add the Word PIA in VS2008: on the Project menu in VS, click on Add Reference.  in the .NET tab, click on Microsoft.Office.Interop.Word and then click OK.  for more information about the PIAs, you can read Office Primary Interop Assemblies.

     

    Normally, the error for a missing PIA is something like "The type or namespace name 'Interop' does not exist in the namespace 'Microsoft.Office' (are you missing an assembly reference?)" 

     

    m.

    Friday, February 8, 2008 10:12 PM
    Moderator
  • I do not have any problems with compiling the application. The problem is with the setup program. I have added the Microsoft.Office.Tools.Word.dll as an assembly to copy to the target machine. It requires Microsoft.Office.Interop.Word which is in the GAC but does not shouw up in the .Net tab.

     

    Tuesday, February 12, 2008 12:16 PM
  • to deploy the primary interop assemblies, you should use the PIA redistributable.  this is a required but separate step because the end user must accept the EULA.  you can find the download link to the PIAs in the How to: Install Office Primary Interop Assemblies topic. 

     

    m.

    Tuesday, February 12, 2008 3:30 PM
    Moderator
  • I understand that it is the way to do it. My problem is how do I convince VS 2005 to compile the setup program and not to give me “An error occurred while validating. …”

     

    Tuesday, February 12, 2008 3:35 PM
  •  Ockert Labuschagne wrote:

    I understand that it is the way to do it. My problem is how do I convince VS 2005 to compile the setup program and not to give me “An error occurred while validating. …”

     

     

    Solution Explorer - [Your Setup Project] - Detected Dependencies - Microsoft.Office.Interop.Word

     

    right click on this item, choose Exclude.

     

    then do the same thing to all PIA & VSTO Runtime assemblies detected by the setup project.

     

    These assemblies should always be excluded because they should be installed by seperate PIA & VSTO Runtime setup applications as Mary said.

     

    hope this helps,

     

    Jie

    Wednesday, February 13, 2008 7:50 AM
  • Unfortunately,  these steps do not work.  I am also unable to find the Microsoft.Office.Interop.Word assembly in the .Net tab.

     

    I've installed the Primary Interop Assemblies for Office 2007.  I confirmed that the Microsoft.Office.Interop.Word assembly is installed in the GAC on my computer.  However, the specific Word assembly does not appear in the .Net tab.

     

    Is there another step I need to complete, in addition to installing the Primary Interop Assemblies?

     

    Wednesday, April 16, 2008 2:12 AM
  • It is a VS2005 problem. I installed VS2008 and upgraded my projects to VS2008 and the problem is no more!

     

    Friday, April 18, 2008 9:41 PM
  • There is no problem when you add the reference of Microsoft.Office.Interop.Word but the problem is on target machine where the ms-word is not installed.

    I do not have any problems with compiling the application. The problem is with the setup program. I have added the Microsoft.Office.Tools.Word.dll as an assembly to copy to the target machine. It requires Microsoft.Office.Interop.Word which is in the GAC. but does not shouw up in the .Net tab. and when my code tries to access the Microsoft.Office.Interop.Word assembly it reports an error of "Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154".


      

    Friday, May 6, 2011 6:35 AM
  • Hi Eengr_Muneer

    <<There is no problem when you add the reference of Microsoft.Office.Interop.Word but the problem is on target machine where the ms-word is not installed.>>

    Word (and any other Office application) must be installed in order to programmatically work with it. The DLLs alone are not enough - they only provide the API, but the actual work is done by the full application.

    Nor are you allowed to distribute any Office application as part of your solution. The Office applications are end-user products and licensed as such. There is no "distributable". When the Office applications are installed, the .NET APIs are installed automatically if the .NET Framework is present. Otherwise your solution has to install the .NET Framework and later the PIAs.


    Cindy Meister, VSTO/Word MVP
    Friday, May 6, 2011 6:40 AM
    Moderator