I have successfully created C++ functions and compiled/linked them into a
and called them from VBA after using the Declare statement in the VBA module
where used. However, I need to bind the function to the call at run time,
like can be
in C/C++ using function pointers. One is supposed to be able to do something
this using the Application.Run command, but that's where my problem arises.
VBA Help gives a syntax:
expression.Run(Macro, Arg1, Arg2, ...)
where expression evaluates to something that supports the Run method.
is the name of the function to be run. Specifically, it says:
"Macro Required Variant for Syntax 1 (not used with Syntax 2). The macro
run. This can be either a string with the macro name, a Range object
indicating where the function is, or a register ID for a registered DLL
(XLL) function. If a string is used, the string will be evaluated in the
context of the active sheet."
I have not been able to make this work for functions that I write and put in
a DLL. Most likely, my problem is I don't know exactly what
" a register ID for a registered DLL (XLL) function" means in this context.
does one "register" a DLL function in the sense used here?