VBA 6 and OLE, how do you find a class?

bj6671

New Member
Joined
Jul 25, 2007
Messages
16
I need to control a terminal program from withoin VBA6, and I've been having a boat load of problems. I have just one question that MIGHT clear up all of the issues I've been having.

Basically, I tried putting the terminal window in my form, but I ran into some other problems. So now I wanted to try to CreateObject the application and work with it from there. In the terminals help file, it talks about referencing OLE objects to be able to automate other programs from within the terminal program. Given this info, it stands to reason there is also a class I can CreateObject to control the terminal... but I don't know what it is.

There are over 200 DLL's and about 35 references for this suite, and most of them have nothing to do with the terminal. I've tried going through all of them, but I can't find the one I'm looking for, I could have easily over looked it. There must be some way to see the Classes that are available for CreateObject to open, or another way to open it that will tell me what class it is for automation.

I would normally have contected their help department, but it is a pay-per-incident help line and I'm not authorized to do that.

Basically, I'm looking for an easier way to find the class to CreateObject on. Any help?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
A couple of suggestions :

- Search the registry under : HKEY_CLASSES_ROOT \ ClassID

- Put a (document of the application if feasible) in an OLE container in your Form and call the ProgID Method of the OleObject

- Automate your search using the VBE .

- Look in the Object Browser

Regards.
 
Upvote 0
Jaafar Tribak, thank you for your reply.
1. Unfortunately, the workstation I'm on is locked down, I can't even look at the system calender, much less the registry. :-(

2. I'm interested in this method... the terminal application doesn't have any documents, but could you expound on OLE container? I haven't heard that term before (I'm pretty new to OLE). I'll Google it in the mean time...

3. I'm afraid I don't understand this one at all.

4. I tried going through the Object browser and adding ever reference I could find that was in the propper directory. Then I tried CreateObject on all of th elikely classes. There are so many, that it is possible that I missed the one I was looking for.
 
Upvote 0
bj6671?

2- In Excel for example, one can embeed a OLEObject into a worksheet and sometimes find the Class name (or a close one) by looking in the Formula bar when the OLE Object is selected or by calling the ProgID Method in code.This could give you a clue as to what the Class name might be.

3- You said you could have easily over looked a reference in your project references when going through them in the references dialoge box. If you automate this manual search using the VBIDE object , you can get on the fly information about every DLL, EXE....that are referenced to your project. Info like FullPath, Guid, Description...

Again, using the VBIDE object, you can also use the AddFromFile Method of the References Collection. So if you know in which directory the Application EXE might reside, you can add a reference to all the files in the directory on the fly.

I wish I was more familiar with the VB environment. I am just suggesting here what i would do if this was needed in Excel/VBA which I beleive is very similar.

Maybe you should post this question in a VB forum.

Hope this helps.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,225,360
Messages
6,184,506
Members
453,237
Latest member
lordleo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top