Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thank you , I m going to try the dedicated modules
Regards Anthony "Peter T" <peter_t@discussions wrote in message ... The conditional compile will only distinguish betweem XL2000+ and XL97 #If VBA6 Then s = Replace("AZ", "Z", "B") #Else s = Application.Substitute("AZ", "Z", "B") #End If You can trap Excel's version like this xlVer = Val(Left$(Application.Version, 2)) If you want to call a Excel function that was say introduced in XP and will fail in earlier versions, place the code in a dedicated module for later version stuff that will never be called in earlier versions. Alternatively, depending on what you are doing, you might be able to get away with something like this - Dim oRng as Object ' note as object not as Range If xlVer = 9 then oRng.some-XL-Func(arg's) Else oRng.some-XL-Func(extended later version arg's) End if above would be suitable with functions like Find and Sort Regards, Peter T "Anthony" wrote in message ... I am aware of the application.version function and I can also use the conditional compile using the #if #else #endif statements. What I need to do though is determine the version at run time and then run different code depending. The conditional code needs a const which I cant set at run time. The various code is used to close of certain functionality of the workbook etc... and this varies between versions. Thanks in advance Anthony |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA Code Recompilation with new version of COM Dll | Excel Programming | |||
Conditional Compilation Based On Excel Version | Excel Programming | |||
Code Glitch from version to version | Excel Programming | |||
Code for Trial Version | Excel Programming | |||
How to find the version of Excel in code | Excel Programming |