Valik Posted July 31, 2008 Share Posted July 31, 2008 Hmm... thought I found a trick, but can't make it work yet... Any hints on how to iterate the ROT in AutoIt? The examples all seem to be VB or VB.Net, not VBScript. P.S. NVM, looks like everybody got there before me.Hmm. Your quoted text seems to blow my theory apart. I didn't read the code close enough, apparently, and thought it was doing application-level registration and not document-level registration.I guess I'll have to think of something else to overcome the limitation. Link to comment Share on other sites More sharing options...
Valik Posted August 1, 2008 Share Posted August 1, 2008 (edited) Interesting. It turns out my theory was right and the text posted by PsaltyDS is wrong. That's why it pays to test things and not rely on what others say.I'm looking at the Running-Object-Table on my system right now and I see 3 instances of Excel. All of them have the same display name but they all obviously represent different objects. It makes perfect sense. Each object registers itself when it starts. They don't do any complicated checks for other running instances or monitor for another instance to close so it can register itself. They all just register and let the table manage itself. That's why you can close one instance of Excel and the next instance will be returned by ObjGet("", "Excel.Application"). I observe this with Office 2007 but I bet it applies to all versions. At any rate, I'll test with Office 2003 to confirm. However, now that I see multiple objects with the same moniker can be registered, I guess I do have to implement #488 after all.Edit: Worked with Office 2003 as well. Probably pretty standard for objects to have multiple instances registered in this manner. Which means an instance parameter in ObjGet() would be super useful. Edited August 1, 2008 by Valik Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 4, 2008 Share Posted August 4, 2008 (edited) It turns out my theory was right and the text posted by PsaltyDS is wrong.Like THAT has never happened before! That's why it pays to test things and not rely on what others say.I'm looking at the Running-Object-Table on my system right now and I see 3 instances of Excel. All of them have the same display name but they all obviously represent different objects. It makes perfect sense. Each object registers itself when it starts. They don't do any complicated checks for other running instances or monitor for another instance to close so it can register itself. They all just register and let the table manage itself. That's why you can close one instance of Excel and the next instance will be returned by ObjGet("", "Excel.Application"). I observe this with Office 2007 but I bet it applies to all versions. At any rate, I'll test with Office 2003 to confirm. However, now that I see multiple objects with the same moniker can be registered, I guess I do have to implement #488 after all.Edit: Worked with Office 2003 as well. Probably pretty standard for objects to have multiple instances registered in this manner. Which means an instance parameter in ObjGet() would be super useful.How about ObjGetCollection()? Does it make sense (and is it possible) to get the ROT as a collection object, similar to Dale's _IEFormGetCollection(), where you get a collection by default, or you can specify an instance by 0-based index? For example ObjGetCollection("Excel.Application") would return a collection of all Excel instances, but ObjGetCollection("Excel.Application", 0) returns the first instance only. Edit: Added example. Edited August 4, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Valik Posted August 4, 2008 Share Posted August 4, 2008 Ehh, technically yes it's possible but AutoIt would have to implement it all. I don't think it's really any better than what I suggested as it ends up being similar code to use it but internally it ends up being a lot more work since AutoIt would have to implement a collection object to server it. Link to comment Share on other sites More sharing options...
ptrex Posted August 5, 2008 Share Posted August 5, 2008 @Valik While your mind is set to COM stuff. Maybe you could look at #50 as well. Thanks. Regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 8, 2010 Share Posted June 8, 2010 Ehh, technically yes it's possible but AutoIt would have to implement it all. I don't think it's really any better than what I suggested as it ends up being similar code to use it but internally it ends up being a lot more work since AutoIt would have to implement a collection object to server it.@Valik: I'm thinking about trying an update to some Excel.au3 functions with a few goals that would help in my own usage: 1. Straighten out Application/Workbook references for consistency2. Implement COM arrays in/out vice cell-by-cell access of data in the functions3. Update functions and docs to clear up the confusing world of application/document instancesIt looks like implementation of Trac #488 would help with at least some of this. Any chance of it getting some attention soon? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now