Know what other Workbooks are open

  • Thread starter Thread starter OMER
  • Start date Start date
O

OMER

Hola,
I have a workbook that needs to run when no other workbook is open.
Is there a way to know from withiin a macro if there are other workbooks so
I can instruct the user to close these workbooks and run my file again?

Thank you for your help.
Regards,
OMER
 
Here's an example of counting the workbook objects (including hidden ones -
like Personal.xls)

Sub HowManyWorkbooks()

Dim i as Long

i = application.workbooks.count
msgbox i & " workbooks are open"

End Sub
 
Thank You very much for your prompt and effective response. That was exactly
what I was looking for ;)

Regards,
OMER
 
Back
Top