Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Workbooks collection

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Workbooks collection


Dave;189707 Wrote:
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?


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 do
this?


--
Leith Ross

Sincerely,
Leith Ross

'The Code Cage' (http://www.thecodecage.com/)
------------------------------------------------------------------------
Leith Ross's Profile: http://www.thecodecage.com/forumz/member.php?userid=75
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=52258

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Workbooks collection

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

"Leith Ross" wrote:


Dave;189707 Wrote:
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?


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 do
this?


--
Leith Ross

Sincerely,
Leith Ross

'The Code Cage' (http://www.thecodecage.com/)
------------------------------------------------------------------------
Leith Ross's Profile: http://www.thecodecage.com/forumz/member.php?userid=75
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=52258


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy/ move selected data from workbooks to seperate worksheets or workbooks Positive Excel Worksheet Functions 1 August 30th 07 04:54 PM
Referring to a member of the workbooks collection by name. Andrew[_3_] Excel Programming 5 May 11th 07 11:34 AM
Workbooks collection is empty even though the some of the document is open [email protected] Excel Programming 12 December 28th 05 10:47 AM
Collection Todd Huttenstine Excel Programming 4 December 17th 04 09:41 PM


All times are GMT +1. The time now is 05:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"