Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automation multiversion excel 2003-2007
Hi lads.
I use simple excel automation im my c# 2.0 app. I do it like in MS samples ,add reference to excel com libraries ,createobject ,etc and transfer DataTable to Excel. But as far as I can see they changed object model in excel 2007 ,so i can't run my app on the PC with excel 2007 installed . Of course I can change refernce to libraries and make small changes to the export functions ,but the modified version will not work on old 2003 excel PC's Can you help me with this problem ? I wanna run my app on both versions |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automation multiversion excel 2003-2007
Use two sets of code. Check the application version and run the appropriate code. Be aware that some XL 2003 code will not work on earlier XL versions. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "bull73" wrote in message Hi lads. I use simple excel automation in my c# 2.0 app. I do it like the MS samples, add reference to excel com libraries, createobject, etc and transfer DataTable to Excel. But as far as I can see they changed object model in excel 2007, so i can't run my app on the PC with excel 2007 installed. Of course I can change refernce to libraries and make small changes to the export functions, but the modified version will not work on old 2003 excel PC's Can you help me with this problem ? I want to run my app on both versions |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automation multiversion excel 2003-2007
Jim Cone wrote: Use two sets of code. Check the application version and run the appropriate code. Be aware that some XL 2003 code will not work on earlier XL versions. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "bull73" wrote in message Hi lads. I use simple excel automation in my c# 2.0 app. I do it like the MS samples, add reference to excel com libraries, createobject, etc and transfer DataTable to Excel. But as far as I can see they changed object model in excel 2007, so i can't run my app on the PC with excel 2007 installed. Of course I can change refernce to libraries and make small changes to the export functions, but the modified version will not work on old 2003 excel PC's Can you help me with this problem ? I want to run my app on both versions Thanks a lot ,do you have some sapmle ? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automation multiversion excel 2003-2007
C# is a foreign language to me, so I am speaking about Excel VBA code only. (this is not a C# newsgroup) Assuming you have an object reference to Excel of objAppXL... 'Val is a VBA function that returns the number contained in a string ' as a numeric value of appropriate type 'Version is a string property that returns the application version. '-- x = Val(objAppXL.Version) If x < 12 Then 'run xl2003 code Else 'run xl2007 code End If '-- If run from an Office application, you would want the xl2003 code and the xl2007 code in separate modules to avoid compile problems. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "bull73" wrote in message Jim Cone wrote: Use two sets of code. Check the application version and run the appropriate code. Be aware that some XL 2003 code will not work on earlier XL versions. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "bull73" wrote in message Hi lads. I use simple excel automation in my c# 2.0 app. I do it like the MS samples, add reference to excel com libraries, createobject, etc and transfer DataTable to Excel. But as far as I can see they changed object model in excel 2007, so i can't run my app on the PC with excel 2007 installed. Of course I can change refernce to libraries and make small changes to the export functions, but the modified version will not work on old 2003 excel PC's Can you help me with this problem ? I want to run my app on both versions Thanks a lot ,do you have some sapmle ? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automation multiversion excel 2003-2007
IMO, you'd want the 2003 and 2007 code in two separate add-ins. Seemingly
more work, but probably easier in the long run. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "Jim Cone" wrote in message ... C# is a foreign language to me, so I am speaking about Excel VBA code only. (this is not a C# newsgroup) Assuming you have an object reference to Excel of objAppXL... 'Val is a VBA function that returns the number contained in a string ' as a numeric value of appropriate type 'Version is a string property that returns the application version. '-- x = Val(objAppXL.Version) If x < 12 Then 'run xl2003 code Else 'run xl2007 code End If '-- If run from an Office application, you would want the xl2003 code and the xl2007 code in separate modules to avoid compile problems. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "bull73" wrote in message Jim Cone wrote: Use two sets of code. Check the application version and run the appropriate code. Be aware that some XL 2003 code will not work on earlier XL versions. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "bull73" wrote in message Hi lads. I use simple excel automation in my c# 2.0 app. I do it like the MS samples, add reference to excel com libraries, createobject, etc and transfer DataTable to Excel. But as far as I can see they changed object model in excel 2007, so i can't run my app on the PC with excel 2007 installed. Of course I can change refernce to libraries and make small changes to the export functions, but the modified version will not work on old 2003 excel PC's Can you help me with this problem ? I want to run my app on both versions Thanks a lot ,do you have some sapmle ? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Publisher Policies
Bear in mind that when you install office 2007, a publisher policy in the golbal assembly cache will prevent you from using the 2003 primary interop assemblies at runtime. You'll have to circumvent that in some way, or you'll get compatability warnings.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Ole Automation and Excel 2007 footer | Excel Worksheet Functions | |||
Excel 2003 c++ automation problem. | Excel Worksheet Functions | |||
Word 2003 Find/Change Automation from Excel 2003 crashes Excel 200 | Excel Programming | |||
Excel 2003 does not calculate automation add-in functions automati | Excel Programming | |||
Automation and multiversion of Excel | Excel Programming |