Excel/VB Question
I usually never post any threads on stupid questions, but I have been searching and I can't find an answer. Off-topic almost always has an answer 
I am doing an excel project and I have been looking for visual basic code. I want to be able to check how many active windows are open in excel within a macro I'm writing.
I tried: If ActiveWindow=1 Then ... but I come up with an error.
Is there any way to check how many activewindows are open in excel within a vb macro?
THANKS!

I am doing an excel project and I have been looking for visual basic code. I want to be able to check how many active windows are open in excel within a macro I'm writing.
I tried: If ActiveWindow=1 Then ... but I come up with an error.
Is there any way to check how many activewindows are open in excel within a vb macro?
THANKS!
DISCLAIMER: I haven't done VBA / Office stuff since like 96 or 97.
All Windows are in a collection called Windows, whose parent is the Application.
Collections *should* have a count property, so it might be something like:
If (Application.Windows.Count() > 5) Then
...
End If
HTH.
All Windows are in a collection called Windows, whose parent is the Application.
Collections *should* have a count property, so it might be something like:
If (Application.Windows.Count() > 5) Then
...
End If
HTH.
Thread
Thread Starter
Forum
Replies
Last Post




