BUTTON PASSWORD
When I activate a button to run a macro I want to be prompted for a password
is this possible ?
Any suggestions welcome.
it's possible
if you put your routine inside cmdBUTTON_click ...
this is just as simple example
Private Sub cmdBUTTON_click()
On Error GoTo Err_Handler
TryAgain:
Password = InputBox("Enter your password", "ButtonPassword")
If Not Password = "MyPassword" Then GoTo TryAgain
..... enter your code here ....
Exit Sub
Err_Handler:
End Sub
or you may get your password from previously stored place in the register
Private Sub cmdBUTTON_click()
On Error GoTo Err_Handler
RegPassWord = GetSetting "ApplicationName", "Properties", "PAssWordString", "")
TryAgain:
Password = InputBox("Enter your password", "ButtonPassword")
If Not Password = RegPassWord Then GoTo TryAgain
..... enter your code here ....
Exit Sub
Err_Handler:
End Sub
save your password using SaveSetting...