![]() | |
#11
| |||
| |||
|
| "David-W-Fenton" <NoEmail (AT) SeeSignature (DOT) invalid> wrote in message news:Xns9F618D09F12E8f99a49ed1d0c49c5bbb2 (AT) 88 (DOT) 198.244.100... "ron paii" <none (AT) nospam (DOT) com> wrote in news:j4q77f$jjk$1 (AT) dont-email (DOT) me: I have some code in A2010 that interfaces with SolidWorks EPDM api using early binding. Basically, you need to find the name of the component that you need to initialize with CreateObject. You have to poke around the registry for this. I would start by looking up the name of the file in the early binding reference, and then search the registry for that. With this API New is used instead of CreateObject. I am thinking that the application is running under Windows explorer. See my code posted earler. |
#12
| |||
| |||
|
|
"David-W-Fenton" <NoEmail (AT) SeeSignature (DOT) invalid> wrote in message news:Xns9F618D09F12E8f99a49ed1d0c49c5bbb2 (AT) 88 (DOT) 198.244.100... "ron paii" <none (AT) nospam (DOT) com> wrote in news:j4q77f$jjk$1 (AT) dont-email (DOT) me: I have some code in A2010 that interfaces with SolidWorks EPDM api using early binding. Basically, you need to find the name of the component that you need to initialize with CreateObject. You have to poke around the registry for this. I would start by looking up the name of the file in the early binding reference, and then search the registry for that. With this API New is used instead of CreateObject. I am thinking that the application is running under Windows explorer. See my code posted earler. |
|
Set m_Vault = New EdmVault5 |
#13
| |||
| |||
|
|
ron paii wrote: "David-W-Fenton" <NoEmail (AT) SeeSignature (DOT) invalid> wrote in message news:Xns9F618D09F12E8f99a49ed1d0c49c5bbb2 (AT) 88 (DOT) 198.244.100... "ron paii" <none (AT) nospam (DOT) com> wrote in news:j4q77f$jjk$1 (AT) dont-email (DOT) me: I have some code in A2010 that interfaces with SolidWorks EPDM api using early binding. Basically, you need to find the name of the component that you need to initialize with CreateObject. You have to poke around the registry for this. I would start by looking up the name of the file in the early binding reference, and then search the registry for that. With this API New is used instead of CreateObject. I am thinking that the application is running under Windows explorer. See my code posted earler. It's a COM object or else you wouldn't be able to use it in VBA. What you need to find out is the name of the COM library containing that object. Let's look at your code: Set m_Vault = New EdmVault5 So what this line of code does is instantiates a new EdmVault5 object and points the m_Vault variable at it. Notice that you did not have to qualify the EdmVault5 object name with the name of the COM library that contains the object. The reason this line of code works is that you set a reference to the library containing this object in Tools>References. Because you did that, you did not have to use CreateObject to instantiate it. In addition, you were also relieved of the requirement to qualify the object name with its library name. If you try to create a recordset object using Set rs=New Recordset when you have both ADO and DAO references, you have to qualify the object name in order not to get the "default" object, which depends on the order the references appear in your References list. I.E., if ActiveX Data Objects appears first, you will get an ADODB recordset. If DAO is first, you will get a DAO recordset. In order to control which one you get, you need to qualify the object with the name of the library. To guarantee you get a DAO recordset, you need to use: Set rs=New DAO.Recordset If you want an ADO recordset you need to use Set rs=New ADODB.Recordst If you want to use late binding to get an ADO recordset (without setting a reference), you have to use CreateObject (using New requires a Reference) and you have to use the fully qualified object name when calling CreateObject: Set rs=CreateObject("ADODB.Recordset") Are things becoming clearer yet? Hopefully you are beginning to realize the need to discover the name of the library containing that EdmVault5 object. I think the easiest way to do that is to use the Object Browser in the VBA IDE. When you open the Object Browser (press F2 while a code window is open), you should see a dropdown that will contain the names of all the libraries for which you have set References (usually Access, DAO, VBA and stdole will be listed, along with any other libraries you have Referenced). It should be fairly simple to look at that list and figure out which one is the EDM library. If not, type EdmVault5 into the search box and click the search button. The search results include a column for the name of the library containing the class (object). Alternatively, you can search your machine's registry to discover the name of the library, but you should not have to if you've added a Reference to the library. Anyways, once you have the name of the library, you should be able to instantiate EdmVault5 using: set m_Vault=CreateObject("<libraryname>.EdmVault5") |
#14
| |||
| |||
|
|
After adding a reference to "PDMWorks Enterprise 2011 Type Library The library name listed in Object Browser is EDMLIB Replacing Set m_Vault = New EdmVault5 with Set m_Vault = CreateObject("EdmLib.EdmVault5") results in error number 429, ActiveX component can't create object I am thinking that because it is implemented as a file explorer add-on, I need to automate explorer? |
#15
| |||
| |||
|
|
ron paii wrote: After adding a reference to "PDMWorks Enterprise 2011 Type Library The library name listed in Object Browser is EDMLIB Replacing Set m_Vault = New EdmVault5 with Set m_Vault = CreateObject("EdmLib.EdmVault5") results in error number 429, ActiveX component can't create object I am thinking that because it is implemented as a file explorer add-on, I need to automate explorer? In my experience, if you can use New to instantiate an object, you should be able to use CreateObject. This is puzzling. What happens if you try Set m_Vault = New EdmLib.EdmVault5 ? If that also fails, then that cannot be the library's name. I suggest you try to find a forum/group devoted to that tool and ask there. Thanks for your help |
#16
| |||
| |||
|
|
"Bob Barrows" <reb01501 (AT) NOyahooSPAM (DOT) com> wrote in message news:j57se1$hcb$1 (AT) dont-email (DOT) me... ron paii wrote: After adding a reference to "PDMWorks Enterprise 2011 Type Library The library name listed in Object Browser is EDMLIB Replacing Set m_Vault = New EdmVault5 with Set m_Vault = CreateObject("EdmLib.EdmVault5") results in error number 429, ActiveX component can't create object I am thinking that because it is implemented as a file explorer add-on, I need to automate explorer? In my experience, if you can use New to instantiate an object, you should be able to use CreateObject. This is puzzling. What happens if you try Set m_Vault = New EdmLib.EdmVault5 ? If that also fails, then that cannot be the library's name. Set m_Vault = New EdmLib.EdmVault5 worked. All the support for this API is in .NET, I had to translate it to Access/VBA. |
#17
| |||
| |||
|
|
ron paii wrote: "Bob Barrows" <reb01501 (AT) NOyahooSPAM (DOT) com> wrote in message news:j57se1$hcb$1 (AT) dont-email (DOT) me... ron paii wrote: After adding a reference to "PDMWorks Enterprise 2011 Type Library The library name listed in Object Browser is EDMLIB Replacing Set m_Vault = New EdmVault5 with Set m_Vault = CreateObject("EdmLib.EdmVault5") results in error number 429, ActiveX component can't create object I am thinking that because it is implemented as a file explorer add-on, I need to automate explorer? In my experience, if you can use New to instantiate an object, you should be able to use CreateObject. This is puzzling. What happens if you try Set m_Vault = New EdmLib.EdmVault5 ? If that also fails, then that cannot be the library's name. Set m_Vault = New EdmLib.EdmVault5 worked. All the support for this API is in .NET, I had to translate it to Access/VBA. The only explanation I can come up with for this is that EdmLib depends on another library. Adding a Reference makes that transparent so you don't need to fully qualify it using New. Without the Reference, you need to explicitly qualify every part of the path that gets you to EdmVault5. I would use Object Explorer to dig into it. Perhaps SysInternals Process Explorer can help. I didn't think of Process Explorer. |
#18
| |||
| |||
|
|
The library name listed in Object Browser is EDMLIB |
![]() |
| Thread Tools | |
| Display Modes | |
| |