Dose the wrapper that .Net framework generates backward copatiable?
Do I have to have the same version of Office in production too?
Thanks a lot
Bruce,
I have seen more than one person state that the PIAs themselves are not
particularly interchangeable. Here's an example from
http://blogs.msdn.com/eric_carter/archive/category/4620.aspx:
***
In my previous post I wrote this--but then removed it:
"Note that the Office XP PIAs will work against either Office XP or Office
2003. This is because the PIAs are backed by the COM object models of
Office that are versioned in such a way that the OM of Office XP is a proper
subset of the OM of Office 2003. In other words, if you use the Office XP
PIAs, you get the benefit that your code will work against Office XP and
Office 2003, but you don't get to use any of the cool new developer features
of Office 2003 (like ListObject, XML Support, etc.)."
Although this should be true in theory, it turns out that in practice there
are some areas where the XP PIAs will blow up when you use them against
Office 2003. One example I've been told is that if you are an add-in and
you call Microsoft.Office.Interop.Word.Application.Open() using the XP PIAs
with Office 2003, you can crash Word.
So the current recommendation from Microsoft is not to use Office XP PIAs
with Office 2003.
Based on this it looks like you will have to intall all the PIAs and select
the correct one at runtime based on the Excel version you are dealing with.
I would Google around and see if anyone has some framework code to sort that
all out, before reinventing the wheel.
--Bob
"J-T" <J...@nospam.com> wrote in message
news:eUJY3uOg...@tk2msftngp13.phx.gbl...
I so appreciate your help,
Please let me know as you know more about it.
"Bob Grommes" <b...@bobgrommes.com> wrote in message
news:eL7Q5kPg...@TK2MSFTNGP10.phx.gbl...
Thanks again
"Bob Grommes" <b...@bobgrommes.com> wrote in message
news:eL7Q5kPg...@TK2MSFTNGP10.phx.gbl...
I haven't encountered anyone who's written helper code for determining the
installed version of Excel, but I suspect it might be Google-able. Once you
determine how to do that and write or crib your GetExcelVersion() method,
you would use reflection to reference the appropriate PIA at runtime. I
have done neither, so can't give you specifics. But again -- if you're
really doing some trivial automation, then try it with the XP PIA and see if
it works. No sense complicating matters unless you are forced to.
--Bob
"J-T" <J...@nospam.com> wrote in message
news:eHMFxFYg...@TK2MSFTNGP12.phx.gbl...