Disbale button when worksheet protected
Is there any way of disabling a button on a worksheet when the worksheet is
protected, i.e. I do not want people to click the button to refresh the data if the sheet is protected? (the button is from the Control Toolbox toolbar) Any ideas? |
Disbale button when worksheet protected
I'd just have the code in the commandbutton check to see if the worksheet is
protected: Option Explicit Private Sub CommandButton1_Click() If Me.ProtectContents _ Or Me.ProtectDrawingObjects _ Or Me.ProtectScenarios Then Beep 'or MsgBox "it's protected" Exit Sub End If 'your real code End Sub If you're protecting the worksheet in code, you could disable the commandbutton when you protect/unprotect the worksheet. Sarah (OGI) wrote: Is there any way of disabling a button on a worksheet when the worksheet is protected, i.e. I do not want people to click the button to refresh the data if the sheet is protected? (the button is from the Control Toolbox toolbar) Any ideas? -- Dave Peterson |
All times are GMT +1. The time now is 11:09 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com