Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you find the version of the EXCEL program??? Renee Excel Discussion (Misc queries) 3 September 22nd 09 04:46 PM
How do I find/open older version of file in Excel 2007? GJSchmitz Excel Discussion (Misc queries) 1 February 16th 09 01:27 PM
download trial version excel 2003? can only find trial version 200 susan Excel Discussion (Misc queries) 2 November 7th 07 03:19 AM
Find Version of Excel workbook is saved as Barb Reinhardt Excel Discussion (Misc queries) 0 August 31st 07 02:00 PM
Modify Macro Code Depending on Excel Version John Taylor Excel Discussion (Misc queries) 11 February 26th 07 04:19 AM


All times are GMT +1. The time now is 01:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"