I need a button on a MS Word template to remove itself when it is clicked.
Set ButtonName = Nothing doesn't work
Unload ButtonName also doesn't work
Any suggestions
Is the button created from the Control Toolbox (ActiveX) or is from the Forms toolbar. If it is from the control toolbox it can be set to invisible. Try
Private Sub CommandButton1_Click()
Me.CommandButton1.Visible = False
MsgBox "I'm gone"
End Sub
If it is from the Forms toolbar, you can delete it by something like
I'm using the control toolbar, but I do not get the "visible" command in my smarttext dropdown, nor does it work if I force it. I'm using Office 97--does that make a difference?
Have you actually placed the cod ein the relevant sheet codepane rather than a general module ?
I have tested it on XL97 and it seems to work ok. Right click on the sheet with the control, and select view code. Insert the code in th eresultant window.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.