- Joined
- Sep 25, 2008
- Messages
- 2
- Reaction score
- 0
Good morning,
Can you please help me with some coding.
I have created in XLstart a Macro which adds two buttons for the user to have.
But after I close excel and restart it adds every time the new buttons.
Thiss should have been a one time run.
Can I change this so after closer the buttons are removed ?
Or build in a check that if he sees the buttons he does not add new ones ?
Of course your help is greatly needed. !!
Here is the code :
Private Sub Workbook_Open()
Dim mijnBalk As CommandBar
Dim mijnKnop As CommandBarButton
Set mijnKnop = Application.CommandBars("Worksheet Menu Bar").Controls.Add
mijnKnop.Caption = "&TNT Oude Versie"
mijnKnop.Style = msoButtonCaption
mijnKnop.BeginGroup = True
mijnKnop.OnAction = "TekstNaarKolommen"
Dim mijnBalk1 As CommandBar
Dim mijnKnop1 As CommandBarButton
Set mijnKnop1 = Application.CommandBars("Worksheet Menu Bar").Controls.Add
mijnKnop1.Caption = "&TNT Invoice"
mijnKnop1.Style = msoButtonCaption
mijnKnop1.BeginGroup = True
mijnKnop1.OnAction = "TNT_E_invoicing_J"
End Sub
Thanks !
Can you please help me with some coding.
I have created in XLstart a Macro which adds two buttons for the user to have.
But after I close excel and restart it adds every time the new buttons.
Thiss should have been a one time run.
Can I change this so after closer the buttons are removed ?
Or build in a check that if he sees the buttons he does not add new ones ?
Of course your help is greatly needed. !!
Here is the code :
Private Sub Workbook_Open()
Dim mijnBalk As CommandBar
Dim mijnKnop As CommandBarButton
Set mijnKnop = Application.CommandBars("Worksheet Menu Bar").Controls.Add
mijnKnop.Caption = "&TNT Oude Versie"
mijnKnop.Style = msoButtonCaption
mijnKnop.BeginGroup = True
mijnKnop.OnAction = "TekstNaarKolommen"
Dim mijnBalk1 As CommandBar
Dim mijnKnop1 As CommandBarButton
Set mijnKnop1 = Application.CommandBars("Worksheet Menu Bar").Controls.Add
mijnKnop1.Caption = "&TNT Invoice"
mijnKnop1.Style = msoButtonCaption
mijnKnop1.BeginGroup = True
mijnKnop1.OnAction = "TNT_E_invoicing_J"
End Sub
Thanks !