Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use of Excel APIs for multiple versions of Excel
I am working on a C# application that generates Excel spreadsheets using
Excel APIs. My scope includes support of Excel 2000 and greater (Excel 2002, Excel 2003) etc. Unfortunately, the required parameters for each API have changed with the different versions of Excel. For example, my program works fine with Excel 2000, but does not work with Excel 2002 or Excel 2003 because the APIs have changed. What is the best strategy to use so I can write the application as simple as possible, but at the same time support the various versions of Excel that are available including yet to be released versions? I know there are third party tools available, however I do not want to increase the license cost of the product and require third party software licenses when the user of my application already has Excel. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use of Excel APIs for multiple versions of Excel
I'm not sure what you mean by an "API". Can you give us an example of one
you feel has changed? -- Jim Rech Excel MVP "Ronnie Thompson" wrote in message ... |I am working on a C# application that generates Excel spreadsheets using | Excel APIs. My scope includes support of Excel 2000 and greater (Excel 2002, | Excel 2003) etc. Unfortunately, the required parameters for each API have | changed with the different versions of Excel. For example, my program works | fine with Excel 2000, but does not work with Excel 2002 or Excel 2003 because | the APIs have changed. | | What is the best strategy to use so I can write the application as simple as | possible, but at the same time support the various versions of Excel that are | available including yet to be released versions? | | I know there are third party tools available, however I do not want to | increase the license cost of the product and require third party software | licenses when the user of my application already has Excel. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use of Excel APIs for multiple versions of Excel
If I recall correctly, C# doesn't support optional arguments the same way VB does. When you call a method you have to pass all the arguments, optional or otherwise (there's some kind of special empty value you pass when you aren't going to use the optional argument). So, for example, when they added a ton of optional arguments to the Worksheet.Protect method between Excel 2000 and 2002 it looks the same from VB but completely different from C#. No idea what the solution is though. -- Rob Bovey, Excel MVP Application Professionals http://www.appspro.com/ * Take your Excel development skills to the next level. * Professional Excel Development http://www.appspro.com/Books/Books.htm "Jim Rech" wrote in message ... I'm not sure what you mean by an "API". Can you give us an example of one you feel has changed? -- Jim Rech Excel MVP "Ronnie Thompson" wrote in message ... |I am working on a C# application that generates Excel spreadsheets using | Excel APIs. My scope includes support of Excel 2000 and greater (Excel 2002, | Excel 2003) etc. Unfortunately, the required parameters for each API have | changed with the different versions of Excel. For example, my program works | fine with Excel 2000, but does not work with Excel 2002 or Excel 2003 because | the APIs have changed. | | What is the best strategy to use so I can write the application as simple as | possible, but at the same time support the various versions of Excel that are | available including yet to be released versions? | | I know there are third party tools available, however I do not want to | increase the license cost of the product and require third party software | licenses when the user of my application already has Excel. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use of Excel APIs for multiple versions of Excel
There does not seem to be an "easy" solution since somehow your code will
need to account for any of the changes, and without some sort of specialized tool that can only be done by writing code to deal with any differences. I can only suggest that you could create a custom class (not sure the proper C# terminology?) including the Excel API within the class - then pass a "generic" set of arguments to your new "versionless" Excel object that you can modify (according to version) and pass to the actual API. Makes it easier to use down the road, but it would be a lot of up-front work (which is why people can sell this type of thing as a 3rd party product!) "Ronnie Thompson" wrote: I am working on a C# application that generates Excel spreadsheets using Excel APIs. My scope includes support of Excel 2000 and greater (Excel 2002, Excel 2003) etc. Unfortunately, the required parameters for each API have changed with the different versions of Excel. For example, my program works fine with Excel 2000, but does not work with Excel 2002 or Excel 2003 because the APIs have changed. What is the best strategy to use so I can write the application as simple as possible, but at the same time support the various versions of Excel that are available including yet to be released versions? I know there are third party tools available, however I do not want to increase the license cost of the product and require third party software licenses when the user of my application already has Excel. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multiple Language Versions of Excel | Excel Discussion (Misc queries) | |||
How to you open multiple versions of Excel | Excel Discussion (Misc queries) | |||
Multiple Excel versions. | Excel Discussion (Misc queries) | |||
VB6 COM Add-In for multiple Excel and Word versions | Excel Programming | |||
VB6 COM Add-In for multiple Excel and Word versions | Excel Programming |