Object doesn't support this property or method

seventy9mph

Board Regular
Joined
Apr 16, 2009
Messages
72
I have excel 2007, when I try to run this in Excel 2003 I get this pop up error when I click on my option buttons (option buttons populate cell K5)

"Object doesn't support this property or method"


any help to solve this BIG problem?

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
On Error GoTo err_handle
Application.EnableEvents = False
ActiveSheet.Unprotect ("password")
Select Case Target.Address
    Case "$D$8", "$D$10", "$D$12", "$H$8", "$H$10", "$K$5"
        
        If Range("$K$5") = "ELEV2" Then
            Range("$H$10") = Range("$M$8")
            Range("H8,D12").Select
            With Selection.Interior
                .Pattern = xlNone
                .TintAndShade = 0
                .PatternTintAndShade = 0
            End With
        Range("H10").Interior.Color = 16777062
        Range("D8").Select

        'Range("H10").Locked = True
        
        ElseIf Range("$K$5") = "STA2" Then
            Range("$H$8") = Range("$M$8")
            Range("H10,D12").Select
            With Selection.Interior
                .Pattern = xlNone
                .TintAndShade = 0
                .PatternTintAndShade = 0
            End With
        Range("H8").Interior.Color = 16777062
        Range("D8").Select
                
        ElseIf Range("$K$5") = "GRADE" Then
            Range("$D$12") = Range("$M$8")
            Range("H8,H10").Select
            With Selection.Interior
                .Pattern = xlNone
                .TintAndShade = 0
                .PatternTintAndShade = 0
            End With
        Range("D12").Interior.Color = 16777062
        Range("D8").Select
        
        End If
    ActiveSheet.Protect ("password")
    Case Else:

End Select
cleanup:
   Application.EnableEvents = True
Exit Sub
 
err_handle:
   MsgBox Err.Description
   Resume cleanup

End Sub
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
The "TintAndShade" options do not exist in Excel 2003 or prior. They are new to Excel 2007
 
Upvote 0
You can do an IF on the Version...

If Application.Version >= 12 Then
'Use Code WITH Tintandshade options
Else
'Use Code WithOUT Tintandshade options
End If
 
Upvote 0
Just the tint and shade options. Everything else is fine for 2003.

There is no equivelant.

Xl2007 made leaps and bounds improvements in coloring.
2003 just can't do the much of the stuff 2007 does.
 
Upvote 0
thank you. i will be more mindful of compatibility issues next time. I used your if then and went back to a color index of 34. works like a champ

thanks again Jonmo1
...as always
 
Upvote 0

Forum statistics

Threads
1,215,851
Messages
6,127,291
Members
449,374
Latest member
analystvar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top