View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
B Lynn B B Lynn B is offline
external usenet poster
 
Posts: 131
Default Know what other Workbooks are open

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

"OMER" wrote:

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