Know what other Workbooks are open

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
 
B

B Lynn B

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
 
O

OMER

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

Regards,
OMER
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top