[VBA ORD, V8i] In Excel, GetObject(, "...ApplicationObjectConnector") returns nothing with the V8i OLB, but works fine with the ORD OLB

Yesterday I was running some VBA scripts just fine from Excel with the V8i OLB. (My frustrating symptom was that ElementScanCriteria was working fine. Later the same day, I found that "Set esc = New MicroStationDGN.ElementScanCriteria" was returning an error and taking about a minute to do so, at that.)

With some troubleshooting, I found this:

Earlier yesterday, using the V8i OLB, GetObject(, "MicroStationDGN.ApplicationObjectConnector") would return an object if I had a session of Microstation V8i open. Since due to some event that occurred while I was working, with the same OLB, this function returns nothing even with a session of Microstation V8i open.

Today, GetObject(, "MicroStationDGN.ApplicationObjectConnector") now returns an object only if I had a session of OpenRoads Designer open and the ORD OLB was attached. 

Is this a known issue and is there a workaround?

Parents
  • Hi Derek,

    returns nothing with the V8i OLB, but works fine with the ORD OLB

    I am confused a bit:

    • What is OLB?
    • You mentioned VBA ORD, V8i, but "ORD" typically means OpenRoads Designer, which does not exist in V8i version.
    Is this a known issue and is there a workaround?

    From your description it seems that you have MicroStation V8i (32bit) and OpenRoads Designer CE (64bits) installed in parallel on the same computer.

    You do not write, what Excel you use (version, whether it is 32bit or 64bit).

    I guess that the problem is that GetObject receives a link to "the first available" (maybe running, or last used?) process, registered for MicroStationDGN library. So it can be both MicroStation and ORD.

    In my opinion there is no simple workaround, because it's a combination of features/limitations of COM/ActiveX and how VBA is integrated in Bentley products. But it is not Bentley-specific, you can find plenty of discussions on Internet how to identify "the right" application object.

    The best (but often not possible) solution is to do not mix more products (especially both 32 and 64bits) on the same computer, when VBA is used. You can also try to find relevant discussion about application object (both on this server and on servers like StackOverflow), but it often ends with in detail developers' discussions, with no simple applicable solution provided ;-)

    With regards,

      Jan

  • What is OLB?

    Object Library. It's the mechanism by which VBA can access Excel and Microstation objects.

    but "ORD" typically means OpenRoads Designer, which does not exist in V8i version.

    I realize this. I just happen to have both, as you correctly guessed, so both are worth mentioning here.

    You do not write, what Excel you use (version, whether it is 32bit or 64bit).

    It's version 2209, 32-bit, but I'm not sure that matters, since that certainly didn't change while I was working.

    I guess that the problem is that GetObject receives a link to "the first available" (maybe running, or last used?) process, registered for MicroStationDGN library. So it can be both MicroStation and ORD.

    That might be a reasonable guess, but it's not the right one. A moment ago I had no sessions of Microstation open. Now I have only one session of Microstation open--currently, v8i--complete with an active design file and model. The function still fails to return an object. To be more exact, it raises the error 429 with the description "ActiveX component can't create object".

    On the other hand, as soon as I open ORD, even before loading an active file, the function correctly returns the object. (As was true earlier yesterday with V8i.)

    But it is not Bentley-specific, you can find plenty of discussions on Internet how to identify "the right" application object.

    This path could make sense if it identified ANY application object at all.

    The best (but often not possible) solution is to do not mix more products (especially both 32 and 64bits) on the same computer, when VBA is used. You can also try to find relevant discussion about application object (both on this server and on servers like StackOverflow), but it often ends with in detail developers' discussions, with no simple applicable solution provided ;-)

    This is still missing the point of the observations that I shared in my original post. Especially since my Excel is running 32-bit and according to this proscription of mixing architectures, it should prefer V8i yet it doesn't (not now, anyway), and on the other hand ORD (which it favors, for whatever reason) is 64-bit.

Reply
  • What is OLB?

    Object Library. It's the mechanism by which VBA can access Excel and Microstation objects.

    but "ORD" typically means OpenRoads Designer, which does not exist in V8i version.

    I realize this. I just happen to have both, as you correctly guessed, so both are worth mentioning here.

    You do not write, what Excel you use (version, whether it is 32bit or 64bit).

    It's version 2209, 32-bit, but I'm not sure that matters, since that certainly didn't change while I was working.

    I guess that the problem is that GetObject receives a link to "the first available" (maybe running, or last used?) process, registered for MicroStationDGN library. So it can be both MicroStation and ORD.

    That might be a reasonable guess, but it's not the right one. A moment ago I had no sessions of Microstation open. Now I have only one session of Microstation open--currently, v8i--complete with an active design file and model. The function still fails to return an object. To be more exact, it raises the error 429 with the description "ActiveX component can't create object".

    On the other hand, as soon as I open ORD, even before loading an active file, the function correctly returns the object. (As was true earlier yesterday with V8i.)

    But it is not Bentley-specific, you can find plenty of discussions on Internet how to identify "the right" application object.

    This path could make sense if it identified ANY application object at all.

    The best (but often not possible) solution is to do not mix more products (especially both 32 and 64bits) on the same computer, when VBA is used. You can also try to find relevant discussion about application object (both on this server and on servers like StackOverflow), but it often ends with in detail developers' discussions, with no simple applicable solution provided ;-)

    This is still missing the point of the observations that I shared in my original post. Especially since my Excel is running 32-bit and according to this proscription of mixing architectures, it should prefer V8i yet it doesn't (not now, anyway), and on the other hand ORD (which it favors, for whatever reason) is 64-bit.

Children
No Data