Any idea how to iterate the ROT (Running Objects Table) using the API ?
Thanks.
Printable View
Any idea how to iterate the ROT (Running Objects Table) using the API ?
Thanks.
I do understand the "Running Objects Table"
Are you referring to the currently running processes?
Yes. but I want to connect to those processes so I can automate them.Quote:
Originally Posted by Hack
Regards.
Ok, I have examples of how to list out what is currently running, but I'm not sure what you mean by "automate" them.Quote:
Originally Posted by BLUE_SEA
Why would you want to "automate" running processes? You can enumerate the running processes and optionally terminate one.
Thanks.
I need to get all the running Excel Applications and be able to retrieve and set the cell values in their respective open workbooks via code.
Something similar to the GetObject Method but without having to provide the open workbook path.
I have managed this via the use of a third party DLL but I am wondering if this can be done through the use of APIs from scratch to make my project more portable.
Regards.
Now that we know what you want:
You can use the getObject method for what you want to do. Nothing to with with API however.
See Si's excellent tutorialVB Code:
Dim oXLApp As Excel.Application Dim oXLwb As Excel.Workbook Dim oXLsheet As Excel.Worksheet Set oXLApp = GetObject(, "Excel.Application") 'get each open workbook For Each oXLwb In oXLApp.Workbooks Debug.Print oXLwb.Name 'get each worksheet in each open workbook For Each oXLsheet In oXLwb.Worksheets Debug.Print vbTab; oXLsheet.Name Next Next
http://www.vbforums.com/showthread.php?t=391665
Quote:
Originally Posted by moeur
Thanks moeur BUT that only works accuratly if there is ONE XL app running.
You are out of luck if there are more than one XL instance.
I want to be able to retrieve all the running XL apps.
Any ideas ?
I had a similiar need at work recently. As a result I put together the following solution in the attached zip file, which I'm using in 2 projects so far at work. You'll find 4 drivers and 1 VB6 wrapper class. The main driver to use is 'olelib.tlb,' which should be placed in either the Windows\System or WINNT\System32 folder. The wrapper class's public procedures should allow you to easily return the ROT's open Excel, PowerPoint, and Word path/filenames and, *most* importantly, the Presentation, Document, and Workbook objects in a 2D array. For example, arr(0, x) will be the path/filename and arr(1,x) will be either be the corresponding Presentation, Document, or Workbook object. See the README.txt, too. It has a good bit more detail. Hope that helps.