ThisWokbook.close
27.01.2004 11:17:16
Joey
Folgendes Problem. Ich schliesse Excel mit nachstehendem Code. Ich möchte aber nur das aktive Workbook beenden; alle anderen noch geöffneten Excel-Workbooks sollen geöffnet bleiben... nur wie? ;-)
Bitte um Unterstützung, danke!
Lg
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
Application.CommandBars("WorksheetMenuBar").Enabled = True
Application.DisplayFormulaBar = True
Application.DisplayAlerts = False
ActiveWorkbook.Close
End Sub