Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Application.Commandbars

Forumthread: Application.Commandbars

Application.Commandbars
03.03.2008 11:08:49
rene
Hallo,
kann man(n Frau auch) alle offenen Symbolleisten ausblenden, incl. Menüleiste und beim schließen wieder herstellen? Der u.g. Code funtzt schon, allerdings kann ich nicht wissen, welche Leisten beim öffnen offen sind! Da unterschiedliche Rechner. Es soll nur "Navigation" zu sehen sein? Geht so was?
'Option Explicit

Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error GoTo 0
Application.CommandBars("Navigation").Delete
Application.CommandBars("Worksheet Menu Bar").Visible = True
Application.CommandBars("Standard").Visible = True
Application.CommandBars("Formatting").Visible = True
On Error GoTo 0
End Sub


Sub Workbook_Open()
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Formatting").Visible = False
'Application.CommandBars("Worksheet Menu Bar").Delete
Dim objBar As CommandBar
...........
Danke, rene

Anzeige

5
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Application.Commandbars
03.03.2008 11:15:50
mumpel
Hallo!
Im Archiv steht die Antwort.

Private Sub Workbook_Open()
For Each c In Application.CommandBars
c.Enabled = False
Next
Dein Code
End Sub



Private Sub Workbook_BeforeClose(cancel As Boolean)
For Each c In Application.CommandBars
c.Enabled = True
Next
Application.CommandBars("Navigation").Delete
End Sub


Gruß, Rene

Anzeige
Nachtrag
03.03.2008 11:17:00
mumpel
Das gehört noch dazu: Dim c As Object

rene sagt mumpel, Danke!
03.03.2008 11:27:36
rene
Hallo Rene,
ja das Archiv....sorry, übersehen! Danke Dir für Deine Mühe und vor allem der Hilfe!
LG rene

AW: Application.Commandbars
03.03.2008 11:25:49
marcl
Hallo rene, vercuhe mal das:

Private Sub Workbook_Open()
Dim cBar As CommandBar
For Each cBar In Application.CommandBars
if cBar.Name  "Navigation" Then
cBar.Enabled = False
end if
Next cBar
End Sub


---------------------------------


Private Sub Workbook_Close()
Dim cBar As CommandBar
For Each cBar In Application.CommandBars
cBar.Enabled = True
Next cBar
End Sub


Gruß
marcl

Anzeige
Danke marcl, so soll es sein! Bestens!o.w.T.
03.03.2008 11:36:00
rene
Danke marcl, so soll es sein! Bestens!o.w.T.
;

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige