Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find all running Excel Application objects

Is there a way in vbscript to find all running Excel instances and check
what their open workbooks are?

Thomas


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default Find all running Excel Application objects


"news.bluewin.ch" wrote in message
...
Is there a way in vbscript to find all running Excel instances and check
what their open workbooks are?

Thomas




No , you can call system API's to list all running processes
to count the number of excel instances running but
AFAIK there's no way to specify which yu want to connect
to so as to be able to use automation to check the open
workbooks

Keith


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Find all running Excel Application objects

Hi Thomas,

As Keith pointed out, there's no simple way to do this. You could use
GetObject to get a running instance of Excel, then loop through the Workbook
objects. But there's no way to keep calling GetObject to get new instances
AFAIK.

You'll probably end up using the Windows API functions EnumWindows and
EnumChildWindows to do this. The main Excel application has a class name of
"XLMAIN", and it seems that the workbooks are listed under a subwindow of
XLMAIN with a class name of "XLDESK" (each workbook under XLDESK has a class
name of "EXCEL7"). These may be different in different versions of Excel
(mine is 2002).

Here's a page that has a great utility that should get you started:

http://vbnet.mvps.org/index.html?cod...indowsdemo.htm

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


news.bluewin.ch wrote:
Is there a way in vbscript to find all running Excel instances and
check what their open workbooks are?

Thomas


  #4   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Find all running Excel Application objects

Hi Thomas,
I posted this a while ago. It was used to avoid using specfic instances of Excel while getting an object.
I will enumerate all running instances (and all running tasks). It can be modified to enumerate all workbooks within each instance.
http://www.google.com/groups?hl=en&l...40TK2MSFTNGP10


--
John
johnf 202 at hotmail dot com


"news.bluewin.ch" wrote in message ...
| Is there a way in vbscript to find all running Excel instances and check
| what their open workbooks are?
|
| Thomas
|
|
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
Running a macro from windows application Aerojade Excel Discussion (Misc queries) 1 October 3rd 08 01:19 PM
Excel still running in task manager after closing the application Willem Excel Discussion (Misc queries) 0 December 5th 06 01:56 PM
Running Excel 2000 VBA Application on Excel 2003 Excel Worksheet Functions 0 August 8th 06 06:04 PM
Run-time error '1004' running to excel objects at once Dianna Braden Excel Programming 0 October 16th 03 08:55 PM
Problem in running an application Mohanasundaram[_2_] Excel Programming 0 August 5th 03 08:26 AM


All times are GMT +1. The time now is 04:31 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"