Wie kann ich mit VBA alle Exel Arbeitsmappen mit Ausnahme einer "MeineDatei.xls" schliessen.
Vielen Dank schon mal im voraus
Gruß Peter
Sub Schliessen()
Dim wkb As Workbook
For Each wkb In Workbooks
If (wkb.Name ActiveWorkbook.Name) And (wkb.Name ThisWorkbook.Name) Then
wkb.Close savechanges:=False
End If
Next wkb
End Sub
Ich hoffe, dir hilft das weiter!
Gruss,
Timmy
Sub Zu_machen()
Dim myFile As Workbook
For Each myFile In Workbooks
If myFile.Name <> "MeineDatei.xls" Then
myFile.Close False 'False = ohne speichern, sonst True
End If
Next myFile
End Sub
Gruß Tino