Re: Loading/using a type library
- From: "Karl E. Peterson" <karl@xxxxxxxx>
- Date: Thu, 14 Jun 2007 12:02:10 -0700
Maury Markowitz <MauryMarkowitz@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
References.AddFromFile "c:\apath\blpxxx.dll"
That's not VB. VBA, right? Fundamental difference.
Wait, that won't compile, because of course the library isn't loaded in my
References, so the compiler doesn't know it's going to be there. No problem,
let's just do this...
localBlpHandle = CreateObject("BLP_DATA_CTRLLib.BlpData")
429, ActiveX cannot create object.
Any ideas?
I just do this:
Public Function CheckLibrary(ByVal ProgID As String) As Boolean
Dim obj As Object
' Used to insure we have a DLL.
On Error Resume Next
Set obj = CreateObject(ProgID)
CheckLibrary = Not (obj Is Nothing)
Err.Clear
End Function
Then use late-binding throughout. All you can do, in these cases.
And is there any way to map between the filename, the actual library name,
and the name that appears in the References dialog? They're all different!
With enough registry spelunking, I'm sure it's possible. Not sure I'd ever care
enough to get to that level, though, as it's somewhat-to-pretty useless information
in VB.
--
..NET: It's About Trust!
http://vfred.mvps.org
.
- Prev by Date: Re: Windows 1.x on display
- Next by Date: Re: Compile Only
- Previous by thread: Access report filter
- Next by thread: Re: Loading/using a type library
- Index(es):
Relevant Pages
|