Jun 12th, 2006, 05:23 AM
#1
Thread Starter
Member
Iterating the ROT !
Any idea how to iterate the ROT (Running Objects Table) using the API ?
Thanks.
Jun 12th, 2006, 08:58 AM
#2
Re: Iterating the ROT !
I do understand the "Running Objects Table"
Are you referring to the currently running processes?
Jun 12th, 2006, 09:23 PM
#3
Thread Starter
Member
Re: Iterating the ROT !
Originally Posted by
Hack
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.
Regards.
Jun 14th, 2006, 09:12 AM
#4
Re: Iterating the ROT !
Originally Posted by
BLUE_SEA
Yes. but I want to connect to those processes so I can automate them.
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.
Jun 14th, 2006, 09:28 AM
#5
Re: Iterating the ROT !
Why would you want to "automate" running processes? You can enumerate the running processes and optionally terminate one.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jun 17th, 2006, 08:40 AM
#6
Thread Starter
Member
Re: Iterating the ROT !
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.
Jun 17th, 2006, 04:43 PM
#7
Re: Iterating the ROT !
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.
VB 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
See Si's excellent tutorial
http://www.vbforums.com/showthread.php?t=391665
Jun 18th, 2006, 03:48 PM
#8
Thread Starter
Member
Re: Iterating the ROT !
Originally Posted by
moeur
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.
VB 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
See Si's excellent tutorial
http://www.vbforums.com/showthread.php?t=391665
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 ?
Jun 23rd, 2006, 12:44 PM
#9
New Member
Re: Iterating the ROT !
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.
Attached Files
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width