-
Solved: Only run this command if Excel version is above 2003
I have this code in an .xls workbook designed for use primarily in 2007, in the selection change event (it works very well)
I've been using On Error Resume Next to avoid an error if the workbook is run in 2003,
but prefer to make changes to stay away from that.
** Checking the Excel version as shown below seems to work.
Would like opinions on whether or not this is the cleanest way to go.
[vba]
If Application.Version >= "12.0" Then
If Not Application.CommandBars.Item("Ribbon").Height > 100 Then
'Ribbon is Minimized
'do nothing
' I don't know why but using If Not and Else is working more consitantly with send keys .
Else
Application.SendKeys ("^{F1}")
'~~> Minimize Ribbon
End If
End If
[/vba]
Last edited by frank_m; 10-19-2011 at 01:47 AM.
Reason: rephrased the first sentence to note that the routine has been working well
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules