I have a workbook where I'm trying to hide certain CommandButtons and Shapes when the user clicks on a button. My VBA code to accomplish this logic is:
Sub Oval20_Click()
Worksheets("Input1").Shapes("Oval 20").Fill.ForeColor.RGB = RGB(255, 0, 0) 'On Sheet "Input1", fills Oval Shape 20 with red color
Worksheets("Input2A").Activate 'Jumps to Sheet "Input2A"
ActiveSheet.Unprotect
Worksheets("Input2A").Rows("27:35").EntireRow.Hidden = True
ActiveSheet.Buttons("CommandButton3").Hidden = True
ActiveSheet.Buttons("CommandButton8").Hidden = True
ActiveSheet.Shapes("GroupBox35").Hidden = True
ActiveSheet.Protect
Worksheets("Input2A").Shapes("AutoShape 52").Visible = True
End Sub
Problems:
1. Message Box stating '400' comes up when code is executed
2. CommandButtons are not hidden
3. Shape "GroupBox35" is not hidden
Please help. I've also had no luck finding out what '400' means in this context. Excel is also not being descriptive about this '400'.
Bookmarks