Möchte gerne abfragen ob eine Excel Mappe offen ist und erst dann einen Code ausführen.
If Workbooks ("Test.xls")open Then oder so
Kann mir von Euch jemand sagen wie das richtig geht.
Danke im Voraus
Gerhard
Sub IstWorkbookDa()
Dim wbk As Workbook
For Each wbk In Application.Workbooks
If wbk.Name = "Test.xls" Then
MsgBox "Dein Code"
Exit Sub
End If
Next
MsgBox "nicht vorhanden"
End Sub