Visit myBlog.. currently not active but it will soon be resplendent with news and views. Alsoplease remove any links you may have to my website. it is soon to be closed and replaced with something else.

Visit myBlog.. currently not active but it will soon be resplendent with news and views. Alsoplease remove any links you may have to my website. it is soon to be closed and replaced with something else.

Visit myBlog.. currently not active but it will soon be resplendent with news and views. Alsoplease remove any links you may have to my website. it is soon to be closed and replaced with something else.

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=YDoesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post

Link to post

Share on other sites

GEOSoft 61

And the Obj/COM Reference section in the helpfile has a write-up on this as well.

Dale

I read that Dale but it was of little help.

I need to find all of the available properties, methods and events for a given object. Currenly that's an ADO object but there are others that I need to check as well. So far it's been trial and error. Find 1 that works and then try others that seem that they might. I've been looking for the best method to enumerate all of the tables available i a database without much luck.

Visit myBlog.. currently not active but it will soon be resplendent with news and views. Alsoplease remove any links you may have to my website. it is soon to be closed and replaced with something else.

ActiveX/COM Inspector - overkill for most things, but you can browse available COM objects by ProgId, and even instantiate one, and play around with it. Or you can attach to some currently running COM object (outlook fer instance). This one is the hardest to use that I've come across, but it works great once you know what you're doing.

Share this post

Link to post

Share on other sites

DaleHohm 58

I need to find all of the available properties, methods and events for a given object. Currenly that's an ADO object but there are others that I need to check as well. So far it's been trial and error. Find 1 that works and then try others that seem that they might. I've been looking for the best method to enumerate all of the tables available i a database without much luck.

And you installed and used the OLE/COM Object Viewer that it describes? That is what it does... same with some of the other tools like the TLViewer also mentioned.

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=YDoesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Visit myBlog.. currently not active but it will soon be resplendent with news and views. Alsoplease remove any links you may have to my website. it is soon to be closed and replaced with something else.

Share this post

Link to post

Share on other sites

Locodarwin 1

ActiveX/COM Inspector - overkill for most things, but you can browse available COM objects by ProgId, and even instantiate one, and play around with it. Or you can attach to some currently running COM object (outlook fer instance). This one is the hardest to use that I've come across, but it works great once you know what you're doing.

Share this post

Link to post

Share on other sites

lod3n 3

No, I think you want to point it at "Excel.Application". In any case, if you already have Excel running with something selected, using ActiveX/COM Inspector, you should be able to connect to that existing instance of Excel, and drill down through the methods that way.

But if you are creating a new instance, well, it's not very likely that you'll have anything selected with that instance, right?

Share this post

Link to post

Share on other sites

tns1 0

Well, Application.Selection just shows as an object without any way to drill further, whereas Application.SendKeys() is clearly a method with two parameters. That is what I am expecting to see.

I admit the concepts are a bit fuzzy to me, but the COM objects that allow you to monkey with a spreadsheet are not part of the spreadsheet itself are they? If you take an xls file and drop in onto a machine without excel installed, you won't be able to use COM on it. Those methods are defined as part of an exe, dll, olb or other file. If thats the case, then every parameter list for every method has to be defined in this file doesn't it?

Besides, the tool (TLV) is setup to point at files, not running processes....

Share this post

Link to post

Share on other sites

lod3n 3

Every parameter for every method... well that's kind of missing the point. The objects that are there are created dynamically, depending on the workbook you have open, and the active worksheet, and the currently selected range. You have to open the spreadsheet using COM.

You might make more progress using AutoIt, and picking apart the ExcelCOM UDF. What is it you are trying to do? Here's a quick example. Open a spreadsheet, and select a range of cells, then run this:

Share this post

Link to post

Share on other sites

tns1 0

OK, I downloaded the ActiveX/COM Inspector and I see what you mean. Looking at things dynamically shows what is going on at the time. Still, if I wanted a comprehensive list of every method and property I would expect to be able to get that by examining the lib directly. I think these other tools should let me do that, I just haven't figured it out.

What I have been after is a better understanding of COM so that I could spin my own COM enabled autoit scripts as needed. I have written a small app using ExcelCOM_UDF and I ran across the situation where the low level call to $oExcel.Selection.Find() and $oExcel.Selection.Replace() does not work as expected with Excel 2000 but it does with Excel 2003. I needed to see what the COM interface really looked like for these calls. If I am reading it right, the Inspector shows these calls to have fewer parameters with Excel 2000.

Share this post

Link to post

Share on other sites

tns1 0

I noticed that for Acrobat 5, ActiveX/COM Inspector does not show anything in the running COM object window which is confusing since it looks like Acrobat 5 does have a COM interface and AutoIt scripts can do things like:

(from posted code)

$SourcePDF = ObjCreate("AcroExch.PDDoc")

$SourcePDF.InsertPages()

$SourcePDF.Save()

$SourcePDF.Close

Also, I can drill down in the right pane of ACI and see:

Adobe Acrobat 5.0 Type Library->DispInterfaces->CAcroPDDoc.InsertPages() including the various parameters

The question is, once I have examined the library and found a method like InsertPages() that I'd like to use, how do I know to

use ObjCreate("AcroExch.PDDoc") to get at that method? The string "AcroExch" does not appear in the library, so where is this mapping made?