Workbooks collection

D

Dave

Hi,
XL2003

When I enter: < ?Workbooks.Count > into the immediate window, I only get a
count of workbooks that are open within the active instance of XL. ie, if the
Window menu lists 3 workbooks, then 3 is returned.
However, if there are other instances of XL open on the computer, which do
not appear in the Windows menu, they are ignored.
Is there a way of counting all the open workbooks, regardless of whether or
not they appear in the Windows menu?
 
L

Leith Ross

Dave;189707 said:
Hi,
XL2003

When I enter: < ?Workbooks.Count > into the immediate window, I onl
get a
count of workbooks that are open within the active instance of XL. ie
if the
Window menu lists 3 workbooks, then 3 is returned.
However, if there are other instances of XL open on the computer, whic
do
not appear in the Windows menu, they are ignored.
Is there a way of counting all the open workbooks, regardless o
whether or
not they appear in the Windows menu?

Hello Dave,

It can be done using VBA and API calls and possibly some WMI scripts
The real question in my mind is this for fun or do you really need d
this

--
Leith Ros

Sincerely,
Leith Ross

'The Code Cage' (http://www.thecodecage.com/
 
D

Dave

Hi Leith,
It would be best if I could do it. The operator has to have two workbooks
open - the master, and one other, from which a macro will import data. I am
trying to check if the op has just 2 books open. Since I won't know the name
of the second book, I was hoping to use the Workbooks.count thingy to do
this, then select the workbook that is not the master, etc, etc.
But yes, it is fun. But also necessary.
Regards - Dave
 

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