473,505 Members | 13,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Office XP Primary Interop Assemblies

J-T
I'm trying to read an excell file in my .Net application using Office XP
Primary Interop Assemblies
(http://msdn.microsoft.com/library/de...c_oxppias.asp).
I have installed Office 2003 on my developemnt box.Will my application be
able to read all kinds of Excell file (97-2000-2003)?

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,
Nov 17 '05 #1
4 4055
The PIAs are hand-tuned to improve upon the interop assemblies that can be
automatically generated by VS, so those wouldn't be entirely compatible.

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/ar...ory/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:eU**************@tk2msftngp13.phx.gbl...
I'm trying to read an excell file in my .Net application using Office XP
Primary Interop Assemblies
(http://msdn.microsoft.com/library/de...c_oxppias.asp).
I have installed Office 2003 on my developemnt box.Will my application be
able to read all kinds of Excell file (97-2000-2003)?

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,

Nov 17 '05 #2
J-T
Bob,

I so appreciate your help,
Please let me know as you know more about it.

"Bob Grommes" <bo*@bobgrommes.com> wrote in message
news:eL**************@TK2MSFTNGP10.phx.gbl...
The PIAs are hand-tuned to improve upon the interop assemblies that can be
automatically generated by VS, so those wouldn't be entirely compatible.

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/ar...ory/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:eU**************@tk2msftngp13.phx.gbl...
I'm trying to read an excell file in my .Net application using Office XP
Primary Interop Assemblies
(http://msdn.microsoft.com/library/de...c_oxppias.asp).
I have installed Office 2003 on my developemnt box.Will my application be
able to read all kinds of Excell file (97-2000-2003)?

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,


Nov 17 '05 #3
J-T
>>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.
How should I select the correct one? I need to know somehow which version of
Excell I am getting ? right?
The only thing I want to do with the Excel file is to check the format of
data inside to see if it has a header and footer ,That's it!!!
I think there should be an easier way to this stuff.I don;t need anything
fancy!! only to be able to open the Excell file and check the content.

Thanks again

"Bob Grommes" <bo*@bobgrommes.com> wrote in message
news:eL**************@TK2MSFTNGP10.phx.gbl... The PIAs are hand-tuned to improve upon the interop assemblies that can be
automatically generated by VS, so those wouldn't be entirely compatible.

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/ar...ory/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:eU**************@tk2msftngp13.phx.gbl...
I'm trying to read an excell file in my .Net application using Office XP
Primary Interop Assemblies
(http://msdn.microsoft.com/library/de...c_oxppias.asp).
I have installed Office 2003 on my developemnt box.Will my application be
able to read all kinds of Excell file (97-2000-2003)?

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,


Nov 17 '05 #4
Well if you're going to do something simple and you are targeting XP and
2003, I'd be inclined to write against the XP PIA and test thoroughly with
both versions of Excel and if it works and you think the code will remain
fairly stable (not constantly shifting / expanding requirements) then go for
it. You note that the blogger I quoted gave an example of code blowing up
only if it's running within an add-in. That's a fairly esoteric scenario,
and I imagine other problem areas may be equally off the beaten path.

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:eH**************@TK2MSFTNGP12.phx.gbl...
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.

How should I select the correct one? I need to know somehow which version
of Excell I am getting ? right?
The only thing I want to do with the Excel file is to check the format of
data inside to see if it has a header and footer ,That's it!!!
I think there should be an easier way to this stuff.I don;t need anything
fancy!! only to be able to open the Excell file and check the content.

Thanks again

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
7252
by: guy lateur | last post by:
Hi all, I am trying to write some code (macro's, if you like) to glue together our Office applications (mainly Word, Excel and Outlook). We have a lot of different projects going on...
1
503
by: zfeld | last post by:
1. Where do I get the Office 2003 PIAs? On the MSDN download site there are only downloads for XP office PIAs. Do they automatically get installed to the GAC with the installation of office 2003? ...
4
1600
by: Elephant | last post by:
Helllo, is there a version of Microsoft Office, where you can link .NET Dll's ( assemblies ) with it, instead of COM Dll's? If not, does anybody know when there will be? Thank you for any...
1
2801
by: cybertof | last post by:
Hello, Could you please tell me what's wrong with this code (c# office code behind) : protected void ThisWorkbook_Open() { try {
5
2023
by: Zamolxe | last post by:
I have installed the Visual Studio 2003 FULL With MSDN (ORIGINAL NOT CRACKED :), Office 2003PRO FULL. After installing Office i have insatlled the MSDE form OFFICE CD, IIS is installed. Then:...
1
1541
by: kunallalwani | last post by:
Hi friends, I had a functional requirement of my project to get the text content of any Microsoft Office (xp) related file and show it to the user. I downloaded the Office Xp Primary Interop...
1
350
by: ns2k | last post by:
I add reference office.dll and Microsoft Office Excel Component to my project and use : --------------------------------------- Dim App As Excel.Application, BarName as String ... Dim Bar As...
2
2429
by: William LaMartin | last post by:
I have created a program that allows for the automation of things in Word documents, like changing the values of DocVariables and the links to Excel Sheets. I did it using interoperoperatability,...
6
3840
by: Dylan Copeland | last post by:
Hello newgroup. In my application I'm calling on the Microsoft Word Object Library to run a spell checker. How would I redistribute this object library? Thanks. --------------- -Dylan Copeland...
0
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.