Windows XP Removing Buttons I have created in XLStart

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 !
 
Hey Mark,
Which version of Excel are you using...
Plus you may have to reduce the macro security, if set to HIGH?

Welcome to PCREview Forums :wave:
 
Dear AbsoluteKevster,

Thank you for your quick respons :-)
I use Excel 2003 and security is set to medium.
If I open the file with the macro and enable macro's I will get two new buttons.

I hope you know the anwser

Greetings !
Mark
 
Back
Top