RE: Office PIA:s. Can they be made to work properly?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




I found the only way to reference a version prior to the one on the build
machine is to build your own Interop assembly.
See http://www.devcity.net/Articles/163/1/article.aspx

--scott

--


"KennethBohman" wrote:

> Hi everybody,
>
> I mentioned some time ago that an application getting data from an Excel
> spreadsheet, stopped reading the spreadsheet after the client upgraded from
> Office XP to Office 2003. Well, I thought it still would do, but although
> confirmed in this forum that apparently remained unknown to the application.
> Still needs to be looked into!
>
> This time a client wanted to automatically create a Word document from an
> application. They are on Office 2003 and I’m developing on Office XP. Guess
> what? That didn’t work either! Clearly I was doing something wrong, so I’d
> better try something really simple. I :
>
> 1) Revisited the article: Working with the Office XP Primary Interop
> Assemblies
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_oxppias.asp
> and created that project anew.
>
> 2) Downloaded the trial version of Office 2003 and registered the PIA:s.
> Looks OK in the GAC.
>
> Whatever way I try I can’t make it work even on my computer now. Description
> of basic tests.
> Setup as in the article above:
> Console Application: OfficeXPPIATest
> Setup Project: OfficeXPPIATestSetup
>
> TEST GROUP 1: Console Application only, that is Setup Project not included
> in the build
>
> Test 1: XP PIA:s
> Reference properties show:
> C:\windows\assembly\GAC\Microsoft.Office.Interop.Word\10.0.4504.0…..
> Result:
> a) Build successful
> b) Build+Run successful, but followed by the message:
> <An exception ‘System.Runtime.InteropServices.COMException’ has occurred in
> OfficeXPPIATest.exe. However, a debugger that cannot handle the exception
> type is already attached to the process>
> Comment: this message did not occur before I installed Office 2003.
>
> 2) 2003 PIA:s
> Reference properties show:
> C:\windows\assembly\GAC\Microsoft.Office.Interop.Word\11.0.0.0…..
> Result:
> a) Build successful
> b) Build+Run successful, but message
> An exception ‘System.Runtime.InteropServices.COMException’ has occurred in
> OfficeXPPIATest.exe. However, a debugger that cannot handle the exception
> type is already attached to the process
>
> Conclusion: no difference between XP PIA:s or 2003 PIA:s
>
>
> TEST GROUP 2: Console Application + Setup Project
> 3) XP PIA:s
> Reference properties show:
> C:\windows\assembly\GAC\Microsoft.Office.Interop.Word\10.0.4504.0…..
> a) Build successful
> b) Running the application after installation
> Successful, but message
> An exception ‘System.Runtime.InteropServices.COMException’ has occurred in
> OfficeXPPIATest.exe.
>
> 4) 2003 PIA:s
> C:\windows\assembly\GAC\Microsoft.Office.Interop.Word\11.0.0.0…..
> Result:
> a) Build successful, but
> I) Output window
> Build
> ------ Starting pre-build validation for project 'OfficeXPPIATestSetup'
> ------
> WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E089'
> Version='1.0.5000.0') of assembly 'Microsoft.Office.Interop.Word.dll'
> WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E089'
> Version='1.0.5000.0') of assembly 'Microsoft.Vbe.Interop.dll'
> WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E089'
> Version='1.0.5000.0') of assembly 'Office.dll'
> ------ Pre-build validation for project 'OfficeXPPIATestSetup' completed
> ------
> ------ Build started: Project: OfficeXPPIATestSetup, Configuration: Debug
> ------
> WARNING: Two or more objects have the same target location
> ('[targetdir]\office.dll')
> WARNING: Two or more objects have the same target location
> ('[targetdir]\office.dll')
> WARNING: Two or more objects have the same target location
> ('[targetdir]\microsoft.vbe.interop.dll')
> WARNING: Two or more objects have the same target location
> ('[targetdir]\microsoft.vbe.interop.dll')
>
> II) OfficeXPPIATestSetup references are duplicated, i.e
> Detected Dependencies
> Microsoft.VBE.Interop.dll:
> C:\windows\assembly\GAC\Microsoft.vbe.Interop.Word\11.0.0.0…..
> Microsoft.VBE.Interop.dll:
> C:\windows\assembly\GAC\Microsoft.vbe.Interop.Word\10.0.4504.0…..
> Office.dll: C:\windows\assembly\GAC\Office\7.0.3300.0…..
> Office.dll: C:\windows\assembly\GAC\Office\11.0.0.0…..
>
> b) Running the application after installation
> See test 3
>
> Not very successful as you can all see.
>
> My question really is what to do? Clearly there are problems with the PIA:s,
> but some of you must be writing apps on machines with multiple Office
> versions or on machines running other Office versions than they were
> developed on. However sad I must sound, whatever Microsoft seems to have put
> into .NET is a gotcha to keep you awake at night. Not that I’m getting
> nostalgic about VS 6!!!
>
> --
> Thanks for your help,
>
> Kenneth Bohman
.



Relevant Pages

  • Re: Picture Box
    ... Somewhere in your project you are referencing desktop .NET assemblies. ... \System.Drawing.dll] to solve conflict and get rid of warning. ... null reference exception could result at runtime. ... Deploying 'C:\WINDOWS\assembly\GAC_MSIL ...
    (microsoft.public.dotnet.framework.compactframework)
  • RE: web.config required elements
    ... The exact warning message is: ... Also, for the assemblies I do need, should they be exactly matched between ... Can't I just reference System.Web.Extensions? ...
    (microsoft.public.dotnet.general)
  • Error while referencing my own assembly
    ... I have written an application that consists of different assemblies. ... Everytime I add a new assembly of my own, ... "The reference Enterprise.Product.XY.dll may or may not be valid for the ... but I want to know why I get this warning and what I ...
    (microsoft.public.dotnet.framework.compactframework)
  • Version conflicts between local and GAC
    ... I have a couple of strong name signed library assemblies stored on a local disk ... Assembly A has a "project reference" ... So, the point here is that my app calls A, which calls B, and my app directly ... to solve conflict and get rid of warning. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: circular reference and events
    ... For an object to signal an event to a subscriber, it does need a reference to the object that has subscribed to the event. ... so i thought for the business object to subscribe to a presenter event (go ... That is, you are trying to use types from two different assemblies, in the other assemblies. ... public int Value {get; private set;} ...
    (microsoft.public.dotnet.languages.csharp)