Recently I had to make a WB 2003 and 2007 compatible.
To make my life easy and only have one version to maintain, I bracketed the 2007 code (Ribbon, etc.) and the 2003 code (Commandbars, etc.) with #If / #Else / #EndIf directives
[vba]
Option Explicit
#Const Ver = "2007"
Sub DoStuff()
#If Ver = "2007" Then
Call Do2007
#Else
Call Do2003
#End If
End Sub
[/vba]
1. The #Const is private to each module. Is there any way to avoid that?
2. I find it hard to believe that there aren't any built in directives, such as OS, Platform, Version, etc. Are there some and I'm missing them?
Thanks
Paul