none
Can I run ms office 2003 and ms office 2007 PIA's in the same solution?

    Question

  • I have a solution with a number of projects for a WPF Application.

    Two of the projects are Main and Utilities.

    Main references Utilities.

    Main has a reference to Office PIA 12 for Office 2007 (word, outlook and excel)

    Utilities has a reference to Office PIA 11 for Office 2003 (access)

    In Windows Server 2008 and Windows 7, we have no problem as it works great.

    In Windows XP, the code that uses word and excel interop breaks because I think it is trying to work with the Office PIA 11 instead of 12.

    Is it possible to have references to both Office PIA 11 and 12 in the same solution?

    Please let me know if you need more information, thanks!

    Tuesday, December 11, 2012 6:10 PM

Answers

  • Hi Matador

    An installation of Windows can have multiple PIA versions installed. Have you checked that both sets of PIAs are present on the Windows XP machine? And both versions of Office, as well, since the PIAs will only work if the corresponding version Office is installed.

    I'm curious as to why your solution would need the Access PIAs? Automation (interop) of Access is unusual - mostly, one uses the database which can be done through a database connection - no PIAs necessary...

    Which .NET Framework is your solution built on? If it's 4.0 or later it would also be possible to embed the interop types (of Access, at least) so that you wouldn't be bound to a specific version of the PIA.


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, December 12, 2012 8:38 AM

All replies

  • Hi Elmatador,

    Thanks for posting in the MSDN Forum.

    It's based on my experience that it will work if your implement the general interface of the PIA. However if your used the specific interface which only exist in higher version of the PIA it will get exception. PIA is a kind of wrap class in .NET which used to communicate with the native Office suites' COM interface. So the root case of the PIA is based on the interfaces which COM provided. It will make more sense if you use lower version PIA to develop application and let it work on Higher Office version environment.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, December 12, 2012 6:04 AM
  • Hi Matador

    An installation of Windows can have multiple PIA versions installed. Have you checked that both sets of PIAs are present on the Windows XP machine? And both versions of Office, as well, since the PIAs will only work if the corresponding version Office is installed.

    I'm curious as to why your solution would need the Access PIAs? Automation (interop) of Access is unusual - mostly, one uses the database which can be done through a database connection - no PIAs necessary...

    Which .NET Framework is your solution built on? If it's 4.0 or later it would also be possible to embed the interop types (of Access, at least) so that you wouldn't be bound to a specific version of the PIA.


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, December 12, 2012 8:38 AM