Office 2007 PIAs works on pure Office 2003 machine?

G

Guest

Hi,

For .NET Automation assemblies:

If the target machine is a pure office 2003
machine, would it be 100% supported from
Microsoft, that a .NET application, that is developed
against 2007 would run in all circumstances on
the target machine (Office 2003), if the Office 12 PIAs
(for Office 2007) are installed on the target machine?


ciao Frank
 
N

Norman Yuan

I would say "NO". It is the other way around that would work: Developing
against Office2003, user machine has Office2007.
 
G

Guest

Hi Norman,
I would say "NO". It is the other way around that would work:
Developing against Office2003, user machine has Office2007.

I agree completely. I also hope for an MS Guy, who can confirm that.
Thanks for your help.


ciao Frank
 
J

\Ji Zhou [MSFT]\

Hello Frank,

In my opinion, the answer is also "not 100% supported".

In fact, the scenario here is, we are running Office 2003, but using the
Office 2007 PIA. The reason for it will not be supported is the Office 2007
PIA introduces a lot of new features to the programmers which are not
available in Office 2003. For example, we use Outlook 2007 PIA to automate
Outlook and we get a MAPI property value by PropertyAccessor which is new
introduced in Outlook 2007. If we are calling our code on the client
machines only have Outlook 2003 installed, it will crash apparently.

The same scenario happens when we are creating an Add-in on the development
machines with both Office 2003 and Office 2007. In this case, if we try to
debug an Office 2003 Add in within Visual Studio. Visual Studio will
explicitly start Office 2003, but the publisher policy will make the Office
2007 PIA used in the Add in. So the same problem needs to be taken care
here. I quote the following statements from Andrew's blog article
http://blogs.msdn.com/andreww/archive/2007/06/08/why-is-vs-development-not-s
upported-with-multiple-versions-of-office.aspx

"However, on this imaginary machine we've retained the old version. So,
what happens if you run Excel 2003 explicitly from the Start menu or from
%ProgramFiles%\Office11\Excel.exe directly. Or indeed, if you press F5
within VS, which (on an Excel 2003 project) will also attempt to run Excel
2003 explicitly? Excel 2003 will run, and it will load your add-in, but it
will be using the Excel 2007 PIAs. If there are no breaking changes between
the 2003 and 2007 OMs (and therefore the PIAs), this should probably work
ok - but if there are breaking changes, you're hosed."

Hope this addresses your issue. Please let me know if I can provide any
future help on this issue. Have a nice day!

Best regards,
Ji Zhou
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 
F

Frank Dzaebel

Hello Ji Zhou,

thank you very much for your good support and description.
I agree with it completly.

As my question is now almost answered, could you tell me,
(i can't test it here)

if i have a method in Office 2007 PIA which
signatur is one parameter more, than the
one one the Office 2003 PIA target machine.
Would this be a supported scenario, and does it succeed normally?
(same scenario, PIAs 2007 are installed in GAC
on the Office 2003 target machine -
Environment C# developed Assembly)


ciao Frank
 
J

\Ji Zhou [MSFT]\

Hello Frank,

Currently, I have tested with the following codes which compiled against
Word 2007 PIA, and it works fine on the client machine which has Word 2003
and Word 2007 PIA.

private void button1_Click(object sender, EventArgs e)
{
Word.Application app = new Microsoft.Office.Interop.Word.Application();
app.Visible = true;
object missing = Type.Missing;
app.Documents.Add(ref missing, ref missing, ref missing, ref missing);
app.Selection.TypeText("test");
}

I tried to find a Word PIA 2007 function whose signature has one more
parameter than the corresponding one in 2003, but no results. In my
opinion, if a function exists in both 2003 and 2007 PIA, it should has the
same signature for both version. The only difference is that 2007 PIA
introduces some new functions. The XP and earlier PIA may have less
parameters than the 2003 and 2007 PIA, thus in the 2003 and 2007 version,
these functions are renamed as Documents.Open2000() or
Documents.Open2002(). And the 2003 and 2007 version use the uniform
Documents.Open().

I am not very sure if I have missed something. If you have found a function
whose signature is not consistent in 2003 and 2007. Would you mind let me
knowing its name. So, I will test for you on my side.

Best regards,
Ji Zhou ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
 
F

Frank Dzaebel

Helle Ji Zhou,

thank you for your tests. Its mainly concerning Microsoft Excel.
So the changes are:

[Object Model Changes Since Microsoft Office 2003 [Excel 2007
Developer Reference]]
http://msdn.microsoft.com/en-us/library/bb242669.aspx

Of course Word has these Open2000 methods etc., but Excel i think:
not.
There are method-signatures with more parameters in Excel 2007
than in Excel 2003. This would be worth a test. (preferably C#)


The only difference is that 2007 PIA introduces some new functions.

and of course - if the Signature hasn't changed -
using a newly defined enum-values perhaps
should also make exceptions or unknown behavior i suppose.


ciao Frank
 
F

Frank Dzaebel

supplement .. not very important, because this
thread mainly concerns Excel:

I tried to find a Word PIA 2007 function whose signature has one more
parameter than the corresponding one in 2003, but no results.

I think, there is only one function changed in Word 2007 (referring
2003):

Method "CheckIn" Changed:

Word 2003:
VOID CheckIn (OPTIONAL BOOL SaveChanges = -1, OPTIONAL VARIANT
Comments,
OPTIONAL BOOL MakePublic = 0)

Word 2007:
VOID CheckIn (OPTIONAL BOOL SaveChanges = -1, OPTIONAL VARIANT
Comments,
OPTIONAL BOOL MakePublic = 0, OPTIONAL VARIANT VersionType)

____________________________
[CheckIn Method (Word 2007)]
http://msdn.microsoft.com/en-us/library/bb221474.aspx

[CheckIn Method (Word 2003)]
http://msdn.microsoft.com/en-us/library/aa171823(office.11).aspx



ciao Frank
 
J

\Ji Zhou [MSFT]\

Hello Frank,

I see your point. Actually, the Excel 2007 PIA and Excel 2003 PIA does
provide the uniform interface to the programmers in .NET managed scope. The
changed function signature we referred in the MSDN document is specific to
the COM scope.

Take the Workbook.CheckIn function for example, the story is that Excel 2007
Object Model's signature looks like the following,

Workbook.CheckIn (object SaveChanges, object Comments, object MakePublic,
object VersionType);

But after we use RCW to wrap it, the .NET primary interop assembly exports
two functions. We create the first function is for the PIA's backward
compatibility and the second function to let programmers can still use the
modified function directly in 2007 object model.

Workbook.CheckIn (object SaveChanges, object Comments, object MakePublic);
Workbook.CheckInWithVersion (object SaveChanges, object Comments, object
MakePublic, object VersionType);

The same approach is applied to other changed functions like PrintOut, but
the function names may be different.

Workbook.PrintOut(object From, object To, object Copies, object Preview,
object ActivePrinter, object PrintToFile, object Collate, object
PrToFileName);

Workbook.PrintOutEx (object From, object To, object Copies, object Preview,
object ActivePrinter, object PrintToFile, object Collate, object
PrToFileName, object IgnorePrintAreas);

So, in my opinion, if you are not use these new "WithVersion", "Ex"
functions, your Excel 2007 Automation application should work with the Excel
2003. But as discussed everywhere, that is not a supported scenario from
Microsoft and the recommended way is still programming against 2003 version
and then both 2003 and 2007 version will be OK. What do you think about it?


Best regards,
Ji Zhou ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.


Helle Ji Zhou,

thank you for your tests. Its mainly concerning Microsoft Excel.
So the changes are:

[Object Model Changes Since Microsoft Office 2003 [Excel 2007
Developer Reference]]
http://msdn.microsoft.com/en-us/library/bb242669.aspx

Of course Word has these Open2000 methods etc., but Excel i think:
not.
There are method-signatures with more parameters in Excel 2007
than in Excel 2003. This would be worth a test. (preferably C#)


The only difference is that 2007 PIA introduces some new functions.

and of course - if the Signature hasn't changed -
using a newly defined enum-values perhaps
should also make exceptions or unknown behavior i suppose.


ciao Frank
 
G

Guest

Hi Ji Zhou,

so, as i think the points now are clarified and discussed,
i may make a summary - correct or confirm me if necessary.


1) Executing applications with Office 2007 PIAs
on a sole Office 2003 machine is definitly *not* supported.

It is likely, that Microsoft can not support other
office scenarios when someone uses this unsupported
scenario, because of other sideeffects - as someone
copies the 2007 PIAs in the GAC (of the 2003 system).

2) Typical scenarios of possible crashes (if someone use [1] )
are methods/properties, which have other names
in the two PIAs.

The cases in Excel 2007 PIA fall in 3 classes:

- Methods with the suffix: "WithVersion" are new
in 2007 (old one without suffix). The new one can/will
crash on 2003 Office. The old can/would work (no support).

- Methods with the suffix: "Ex" are new in Excel 2007
(old one without suffix)
The new one can crash on 2003 Office. Old normally works.

- Some Properties are READ-WRITE in Excel 2007.
But in Excel 2003 they are READ-ONLY. So, if using a
setter over the 2007 PIA in Excel 2003, this can crash.

3) Methods, which have the same name and signature
which do not have breaking changes, are ~normally
working (but no Microsoft Support).

4) Only the other direction, where 2003 PIAs are used on a
2007 Office is supported. (technically with policy-assemblies)

5) Normally best practice is, to code exactly against
the PIA of the used Office. If not, use the the lowest
PIA/IA supported for your customers to code against it.




Thank you Ji Zhou for your very good support.
Thanks to Norman too.


ciao Frank
 
J

\Ji Zhou [MSFT]\

Yes, I totally agree with your summary. It is my pleasure to provide
assistance for our customer and you are more than welcome here. Because the
points are clarifies now, I will close this thread on my side at this time.
If you have any new concerns related to this issue, please feel free to
update this thread and I will try my best to follow up.

Have a good day!

Best regards,
Ji Zhou ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Gary Dunne

Hi ... I have developed an application that targets Excel 2003 (using VS
2005), however on the development PC I have both Excel 2003 and 2007
installed. Even though I am explicitly referencing the Excel 11 object
library it uses the 2007 PIAs.
The problem arises then when I roll out to a machine that has only Office
2003 installed. In order to install the 2007 PIAs (using the redistributable
the minimum requirement is that at least one office 2007 application is
installed. This is obviously a deal breaker for my app since I can't require
the client to have to upgrade to Office 2007.

Does anyone know of a way around this behaviour ?

Thanks

Gary
 
N

Norman Yuan

If you are talking VSTO project, MS clearly states that it is not supported
to develop VSTO project on a box with both Office2003 and Office2007
installed.

Gary Dunne said:
Hi ... I have developed an application that targets Excel 2003 (using VS
2005), however on the development PC I have both Excel 2003 and 2007
installed. Even though I am explicitly referencing the Excel 11 object
library it uses the 2007 PIAs.
The problem arises then when I roll out to a machine that has only Office
2003 installed. In order to install the 2007 PIAs (using the
redistributable the minimum requirement is that at least one office 2007
application is installed. This is obviously a deal breaker for my app
since I can't require the client to have to upgrade to Office 2007.

Does anyone know of a way around this behaviour ?

Thanks

Gary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top