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