Add-In
13.09.2004 09:04:32
tobias
ich hab folgende Prozedur zum erstellen eines Menüs in der Symbolleiste.
In Office XP läuft das auch ganz prima aber in Office 2000 löscht er nicht das alte Menü beim öffnen von Excel. Das heist also, bei jedem neuen öffnen hab ich die Einträge einmal mehr in meinem Menü.
Hat damit jemand Erfahrung?
Ich bin für jeden Tipp dankbar.
Private Sub Workbook_Open()
Dim Bar As CommandBar, Menue As CommandBarPopup
Dim Button As CommandBarButton, wka As Workbook
Static StoppAdd As Integer
Set Bar = Application.CommandBars("Worksheet Menu Bar")
On Error Resume Next
Application.EnableEvents = False
Application.ScreenUpdating = False
Set wka = Workbooks("Datenkonsolidierung-Assistent.xla")
If Err <> 0 Then
Bar.Controls("Tools").Delete
On Error GoTo 0
Set Menue = Bar.Controls.Add(msoControlPopup, Before:=Bar.Controls.Count + 1)
Menue.Caption = "Tools"
Set Button = Menue.Controls.Add
With Button
.Caption = "Info"
.OnAction = "Info"
.Style = msoButtonIconAndCaption
.FaceId = 487
End With
Set Button = Menue.Controls.Add
With Button
.Caption = "Word Tabelle importieren"
.OnAction = "Importerladen"
.Style = msoButtonIconAndCaption
End With
Else
Set Menue = Bar.Controls("Tools")
Set Button = Menue.Controls.Add
With Button
.Caption = "Word Tabelle importieren"
.OnAction = "Importerladen"
.Style = msoButtonIconAndCaption
End With
End If
Application.EnableEvents = True
Application.ScreenUpdating = True
StoppAdd = StoppAdd + 1
If StoppAdd > 1 Then Exit Sub
AddInInstall
End Sub
mfg tobias