ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Know what other Workbooks are open (https://www.excelbanter.com/excel-programming/433499-know-what-other-workbooks-open.html)

omer

Know what other Workbooks are open
 
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 Lynn B

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


omer

Know what other Workbooks are open
 
Thank You very much for your prompt and effective response. That was exactly
what I was looking for ;)

Regards,
OMER

"B Lynn B" wrote:

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



All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com