Hi,
I have protected my workbook and have found one of my button is not working. The button un-hides a tab normally when the sheet protection is on by now I have protected the workbook it gives a run-time error '1004' unable to set the visible properties of the worksheet class. I can't work out how to get it to work the code I am currently using is below:
One the sheet opens I then have another button on the new sheet (Stats 1) which returns the user to the main sheet (BCM Database) and hides the tab gain, But again I get the same message run-time error '1004' unable to set the visible properties of the worksheet class. The code I am using for the return is below:
Why is this happening and how do I get the codes to work when the workbook is protected?
Matt
I have protected my workbook and have found one of my button is not working. The button un-hides a tab normally when the sheet protection is on by now I have protected the workbook it gives a run-time error '1004' unable to set the visible properties of the worksheet class. I can't work out how to get it to work the code I am currently using is below:
Code:
Sub BCMDatabase_ViewStats_TextBox1_Click() Sheets("Stats 1").Visible = True
Application.Goto Worksheets("Stats 1").Range("B5")
End Sub
One the sheet opens I then have another button on the new sheet (Stats 1) which returns the user to the main sheet (BCM Database) and hides the tab gain, But again I get the same message run-time error '1004' unable to set the visible properties of the worksheet class. The code I am using for the return is below:
Code:
Sub Stats1_Return_TextBox1_Click() Application.Goto Worksheets("BCM Database").Range("L15")
Sheets("Stats 1").Visible = False
End Sub
Why is this happening and how do I get the codes to work when the workbook is protected?
Matt
Last edited: