Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel Version

Hi,

What code would i put in an Auto_Open macro to detemine the Excel version. I have written and add-in with XL2000, but half of the users have xl97 which is generating code errors. I would like CODE to just close the file unless XL2000 is being used.

Thanks for your help

Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel Version

Mike,

You need application.Version. XL2000 is 9.0, 97 was 8.0 I believe.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mike R" wrote in message
...
Hi,

What code would i put in an Auto_Open macro to detemine the Excel

version. I have written and add-in with XL2000, but half of the users have
xl97 which is generating code errors. I would like CODE to just close the
file unless XL2000 is being used.

Thanks for your help

Mike



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel Version

Excel 2000 and later defines the precomiler variable VBA6

you could put code similar to this in the workbook_open event:

Sub Tester1()
Dim bxl_2000 As Boolean
#If VBA6 Then
bxl_2000 = True
#Else
bxl_2000 = False
#End If
If Not bxl_2000 Then
ThisWorkbook.Close Savechanges:=False
End If
End Sub

--
Regards,
Tom Ogilvy



"Bob Phillips" wrote in message
...
Mike,

You need application.Version. XL2000 is 9.0, 97 was 8.0 I believe.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mike R" wrote in message
...
Hi,

What code would i put in an Auto_Open macro to detemine the Excel

version. I have written and add-in with XL2000, but half of the users have
xl97 which is generating code errors. I would like CODE to just close the
file unless XL2000 is being used.

Thanks for your help

Mike





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel Version

Bob,
This wasn't meant to be posted under your post, but on the same level as an
additional method. Not meant in any way to disagree with the excellent
suggestion you made. My apologies if I created any other impression.

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
Excel 2000 and later defines the precomiler variable VBA6

you could put code similar to this in the workbook_open event:

Sub Tester1()
Dim bxl_2000 As Boolean
#If VBA6 Then
bxl_2000 = True
#Else
bxl_2000 = False
#End If
If Not bxl_2000 Then
ThisWorkbook.Close Savechanges:=False
End If
End Sub

--
Regards,
Tom Ogilvy



"Bob Phillips" wrote in message
...
Mike,

You need application.Version. XL2000 is 9.0, 97 was 8.0 I believe.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mike R" wrote in message
...
Hi,

What code would i put in an Auto_Open macro to detemine the Excel

version. I have written and add-in with XL2000, but half of the users

have
xl97 which is generating code errors. I would like CODE to just close

the
file unless XL2000 is being used.

Thanks for your help

Mike







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
Saving a newer version of Excel using an older version (Excel 97) Alain Dekker Excel Discussion (Misc queries) 7 April 3rd 10 11:02 PM
How do I save an Excel 97-2003 version or 2007 version for Mac 200 Bronigal Excel Discussion (Misc queries) 1 December 7th 09 08:04 AM
download trial version excel 2003? can only find trial version 200 susan Excel Discussion (Misc queries) 2 November 7th 07 03:19 AM
Recover earlier version of excel sheet after new version saved? stephanie38 Excel Discussion (Misc queries) 3 June 17th 05 03:52 AM
How can I update the version of Excel 2000 9.0 to version 10.0 Ramsey Can Excel Discussion (Misc queries) 1 May 11th 05 03:28 PM


All times are GMT +1. The time now is 07:08 AM.

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"