run-time error '1004'


Posted by Frank G on September 17, 2001 4:19 AM

I am getting the following error:

run-time error '1004'
Unable to get the CheckBoxes property of the Workhseet class

Any suggestions?

TIA

Posted by Juan Pablo on September 17, 2001 8:57 AM

Are this checkboxes in a user form ? what i mean is Whic toolbar did you use to insert the checkboxes ?

If it was the VB toolbar then use MSForms.Checkbox

I think that'll take care of the error. If not then please explain some more what you're doing / trying to do.

Juan Pablo



Posted by frank on September 20, 2001 3:33 AM

I am using the checkbook from the Form toolbar.
I have multiple sheets that I want to protect.
I am using Excel 97 SR-2.

Here is the macro I am trying to use for one sheet.

Sub cbProtectSheet_Click()
' Toggles sheet protection
If Sheets("Sun_Scores").CheckBoxes("cbProtectSheet").Value = xlOn Then
ActiveSheet.Protect DrawingObjects:=True, Contents:=True
Else
ActiveSheet.Unprotect
End If
End Sub

I get the run-time error message and the line with
the x1On is highlighted in yellow in the debugger.