Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How Can I tell Excel 2000 to ignore VBA command that are not implemented in
2000, but in later version? "#If VB6 Then" is 'TRUE' for 2000, 2002 and 2003, so I cannot use it. I want to use the .mask feature on a command button in 2002 and 2003, but I want the same code to compile under 2000 and ignore the .mask line. With MenuItem .Caption = "My Button" .Mask = frmIcons.Image1.Picture End With Also 'Application.Version' doesn't work as a compiler directive. I need a way for a # compiler command to distinguish between 2000 , 2002 and Excel 2003. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Roy" wrote in message
... How Can I tell Excel 2000 to ignore VBA command that are not implemented in 2000, but in later version? "#If VB6 Then" is 'TRUE' for 2000, 2002 and 2003, so I cannot use it. I want to use the .mask feature on a command button in 2002 and 2003, but I want the same code to compile under 2000 and ignore the .mask line. With MenuItem .Caption = "My Button" .Mask = frmIcons.Image1.Picture End With Also 'Application.Version' doesn't work as a compiler directive. I need a way for a # compiler command to distinguish between 2000 , 2002 and Excel 2003. Hi Roy, There is no compiler variable that distinguishes among different versions of Excel. What you'd need to do in this case is use late binding by declaring MenuItem As Object and then use an Application.Version check to determine which code to actually execute at run-time: Dim MenuItem As Object ' Set the MenuItem variable here MenuItem.Caption = "My Button" If Val(Application.Version) 9 Then MenuItem.Mask = frmIcons.Image1.Picture End If -- Rob Bovey, Excel MVP Application Professionals http://www.appspro.com/ * Take your Excel development skills to the next level. * Professional Excel Development http://www.appspro.com/Books/Books.htm |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to use my Excel 2003 DTF commands | Excel Worksheet Functions | |||
Can I make excel 2003 use 1-2-3 commands (like in excel 2000)? | Excel Worksheet Functions | |||
Help needed with setting up a complex directive | Excel Programming | |||
Excel 2003 file opend in Excel 2000 - Compile error in hidden modu | Excel Programming | |||
EU Working Time Directive | Excel Discussion (Misc queries) |