Programatically set ref to my DLL

R

ricks

I wrote a very simple ActiveX DLL (in VB6) with a function in
"globalmultiuse" class module.

I can call the function in a module in Excel if I make a manua
"reference" to it in the VBA References dialog window.

1. Is there a way to either call the function directly using th
declare - lib approach?

2. Or can I set the "references" up programatically in a module i
Excel (instead of thru the VBA references editor dialog)?

My intention is to create a set of routines for my company that I ca
distribute to customers (but I don't want the working code to b
visible as in an Excel module). I also want to make it as painless o
the user as possible which is the reason for my questions above...

Thanks for any help,
Ric
 
J

Juan Pablo González

I wrote a very simple ActiveX DLL (in VB6) with a function in a
"globalmultiuse" class module.

I can call the function in a module in Excel if I make a manual
"reference" to it in the VBA References dialog window.

1. Is there a way to either call the function directly using the
declare - lib approach?

2. Or can I set the "references" up programatically in a module in
Excel (instead of thru the VBA references editor dialog)?

My intention is to create a set of routines for my company that I can
distribute to customers (but I don't want the working code to be
visible as in an Excel module). I also want to make it as painless on
the user as possible which is the reason for my questions above...

Thanks for any help,
Rick

You should be able to use late binding with the dll, which should be more
bullet proof. Something like

Dim MyClass As Object
Set MyClass = CreateObject("MyDll.MyClass")

you can search the registry for your dll to see the correct syntax for your
dll.
 
Top