Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Saving a newer version of Excel using an older version (Excel 97) | Excel Discussion (Misc queries) | |||
How do I save an Excel 97-2003 version or 2007 version for Mac 200 | Excel Discussion (Misc queries) | |||
download trial version excel 2003? can only find trial version 200 | Excel Discussion (Misc queries) | |||
Recover earlier version of excel sheet after new version saved? | Excel Discussion (Misc queries) | |||
How can I update the version of Excel 2000 9.0 to version 10.0 | Excel Discussion (Misc queries) |