![]() |
How to find the version of Excel in code
I have a VB6 app that uses instantiates the Excel type
library, but they are different for Excel 97 and Excel 2K. How do I find which version is running so I know what type library to use? I have tried late binding by creating an object from the Excel.Application object, but this doesn't seem to work with different version of Excel. Any other suggestions on how to do be able to have one app run on different computers running different versions of Excel would be greatly appreciated. Thanks in advance, WayneM |
How to find the version of Excel in code
for my xp home, I get 10 when I use this.
MsgBox Left(Application.Version, 2) so if Left(Application.Version, 2)<10 then or use a select case for several versions. "WayneM" wrote in message ... I have a VB6 app that uses instantiates the Excel type library, but they are different for Excel 97 and Excel 2K. How do I find which version is running so I know what type library to use? I have tried late binding by creating an object from the Excel.Application object, but this doesn't seem to work with different version of Excel. Any other suggestions on how to do be able to have one app run on different computers running different versions of Excel would be greatly appreciated. Thanks in advance, WayneM |
How to find the version of Excel in code
Hi WayneM,
I have tried late binding by creating an object from the Excel.Application object, but this doesn't seem to work with different version of Excel. What specifically doesn't work? Late Binding should work well for the situation you describe. Just make sure all Excel-related objects are delcared As Object, and you need to use the actual values of Excel built-in constants instead of the constant names. -- Regards, Jake Marx MS MVP - Excel WayneM wrote: I have a VB6 app that uses instantiates the Excel type library, but they are different for Excel 97 and Excel 2K. How do I find which version is running so I know what type library to use? I have tried late binding by creating an object from the Excel.Application object, but this doesn't seem to work with different version of Excel. Any other suggestions on how to do be able to have one app run on different computers running different versions of Excel would be greatly appreciated. Thanks in advance, WayneM |
All times are GMT +1. The time now is 07:19 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com