Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
392to396
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
392to396
392to396
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

ThisWorkbook.close funkt nicht... Was für Profis!

ThisWorkbook.close funkt nicht... Was für Profis!
04.03.2004 15:28:15
Joey
Hallo!
Bitte um Hilfe! Ich möchte dass nur dieses Workbook geschlossen wird, dass diesen Code enthält. Sollte im Hintergrund ein anderes Workbook offen sein, soll dieses nicht geschlossen werden. Zuerst der Code der das Programm schliessen soll, anschliessend der Code Before_Close. Bitte um Hilfe, ist sehr wichtig, danke!

Private Sub CommandButton1_Click()
Unload Frage_speichern
Dim oBar As CommandBar
Dim iRow As Integer
On Error Resume Next
iRow = 1
With ThisWorkbook.Worksheets("CmdBars")
Do Until IsEmpty(.Cells(iRow, 1))
Application.CommandBars(.Cells(iRow, 1).Value).Visible = True
iRow = iRow + 1
Loop
.Cells.ClearContents
End With
Range("AV4").Select
ActiveCell.FormulaR1C1 = "1"
Application.CommandBars("WorksheetMenuBar").Enabled = True
Application.DisplayFormulaBar = True
Application.DisplayAlerts = False
If Workbooks.Count = 1 Then
Application.Quit
Else
ThisWorkbook.Close True
End If
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Worksheets("Hauptseite") _
.cmdSchliessen.PrintObject = True Then
Cancel = True
Exit Sub
End If
Call AusEinSchalten(True)
Dim oBar As CommandBar
Dim iRow As Integer
On Error Resume Next
iRow = 1
With ThisWorkbook.Worksheets("CmdBars")
Do Until IsEmpty(.Cells(iRow, 1))
Application.CommandBars(.Cells(iRow, 1).Value).Visible = True
iRow = iRow + 1
Loop
.Cells.ClearContents
End With
Application.CommandBars("Worksheet Menu Bar").Enabled = True
Application.DisplayFormulaBar = True
On Error GoTo 0
End Sub

2
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: ThisWorkbook.close funkt nicht... Was für Profis!
04.03.2004 15:47:49
Bertold
Wichtig ist hier immer alles!
Bertold
AW: ThisWorkbook.close funkt nicht... Was für Profis!
08.03.2004 14:05:27
Joey
Hallo Bertold!
Wie meinst Du das, dass immer alles wichtig ist?
Liebe Grüße

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige