Detecting if a Window/Workbook is Open
Try:-
Sub marine()
For Each wb In Workbooks
If wb.Name = ("mybook.xls") Then
MsgBox (wb.Name & " is open")
End If
Next wb
End Sub
Mike
"Rob" wrote:
I was wondering how I would have a macro detect whether or not a workbook is
open.
This is what I tried.......
If Application.Windows("Book1.xls") = True Then
Obviously it doesn't work but does someone know what would?
Thanks Much.
R
|