Author Topic: Determine Prog-ID  (Read 1536 times)

0 Members and 1 Guest are viewing this topic.

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9134
Re: Determine Prog-ID
« Reply #15 on: February 27, 2018, 07:28:32 AM »
This thread quickly morphed into more of a Lisp question then a VB(A) one (I'm beginning to think I spent my time answering the wrong question). ...Shall I move this thread to the appropriate forum?
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

Grrr1337

  • Swamp Rat
  • Posts: 651
Re: Determine Prog-ID
« Reply #16 on: February 27, 2018, 09:28:59 AM »
This thread quickly morphed into more of a Lisp question then a VB(A) one (I'm beginning to think I spent my time answering the wrong question). ...Shall I move this thread to the appropriate forum?

You answered just right, John - its my fault that I tilted the question to what I was exactly trying to do (translate VBA code to LISP).
Still we were inspecting/commenting VBA codes, despite my attempts to write its LISP alternative.

Just to wrap-up in a nutshell the main question/answer + the conclusion I did. :

• Main question:

Is it possible to determine the name of the prog-id, by knowing the library we've accessed from VBAIDE?


• Answer & Discussion:

Code - vb.net: [Select]
  1. object.ProgID
https://msdn.microsoft.com/en-us/library/aa263181(v=vs.60).aspx

A question appeared though, regarding your first post
Code - vb.net: [Select]
  1. object.ProgID
From the reference:
"Returns the ProgID (programmatic ID) for the control represented by the VBControl object."

Performed a test:
<code>

If 'AcroApp' do not have this property, Then what are VBControl object(s) ?
Later I found this
But in my module (VBAIDE from Excel) the definition 'VBControl' is not recognised.

Can anyone provide example how to pull-out ProgID property from such object?

> VBControl object
*Pthhh!* I don't remember exactly, but I think that is more generic and has to do with the stuff on your form for example. Like getting a count from a list box object. ...Microsoft's wording is nice isn't it; they give everything a super vague term.


• Conclusion:

The conclusion I did that its not possible to know/pull-out directly the prog-id from the main 'VB Control' object by knowing its library, since this Progid property doesn't seem to work/exist.
The closest solution is to use a subfunction like _FindProjIDs to find progids with approximately appropriate names and then check if the expected properties/methods/events (from the library) are allowed.
BTW I don't know if VBAIDE has a tool to list the prog-ids, but I was able to find a VBA alternative to Michael's subfoo (although I think he probably already has it as VBA aswell [deep in his puckett]).