View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Late binding to .XLA library??

Could you not check for tha addin being instgalled in the Workbook_Open
(wkith the other code arrangements), and exit nicely if not?

Dim sResult

On Error Resume Next
sResult = Application.AddIns("CFPLus").Installed
If sResult Then
MsgBox "Addin exists"
Else
MsgBox "Addin needs tro be installed"
End If


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Lee S" wrote in message
...
In my spreadsheet I have code that references functions and classes in an
.XLA file. When a user who does not have the .XLA file available opens

the
spreadsheet they see a compile error when the Workbook Open event fires
(even though the Open event itself does not call or even directly

reference
any XLA resources).

This actually makes perfect sense to me ... but that does not mean I

have
to like it.

Anyone know of a reliable way to prevent the compile error in this
situation?

Something comparable to late binding for functions in an XLA library would
be nice. Then I could check if the library exists before I decide whether
to make the function calls.

I have discovered that if arrange my code /just right/, I can avoid the
error by convincing VBA not to compile the modules that reference the
non-existent library -- however that is not reliable enough to release to
the users.

I am tempted to port my .XLA into a Visual Basic and compile it into an
ActiveX DLL, but I figured I would check with the group to see if anyone

had
a good idea on this.

Thanks!
Lee