Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 97 'Error 424' 1

Status
Not open for further replies.

ChrisBurch

IS-IT--Management
Jul 3, 2001
184
AU
Hi all,

I'm getting a 424 'Object required' when the following sub gets to the option button state change.

Can anyone assist?

Sub Blank_Sheet()
'
' Blank_Sheet Macro
' Macro recorded 28/02/2002 by Chris Burch
'
On Error GoTo ErrorHandler

ActiveSheet.Unprotect

' Clear the sheet contents

Range("B4:D4,A17:J44").Select
Selection.ClearContents
Range("B4").Activate

'Make sure sheet status is set to 'Part',
'by setting option buttons


OptComp.Value = False 'Option button
OptPart.Value = True 'Option button

ActiveSheet.Protect
ErrorExit:

Exit Sub
ErrorHandler:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description, vbExclamation
Resume Next 'ErrorExit

End Sub Chris

It worked yesterday.
It doesn't work today.
That's Windows!
 
Chris
Two reasons to get such a message would be...

1. the optPart and optComp controls do not exist on this
sheet.
2. this subroutine has been moved from a specific sheet to a module where the controls would need to be qualified
(activesheet.optpart.value).

dsb





 
Thanks dsb,

The sub is called by a Button which is on the same sheet as the option controls, in fact the Workbook has only got the one sheet. So I still can't see why it wasn't working.

No matter though, I changed to activesheet.optpart.value and it works fine.

Yerbloodsworthbotling Chris

It worked yesterday.
It doesn't work today.
That's Windows!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top