Thanks in advance,
Nick Brook
Nick,
I've just been through this. Did you use the REGISTER.ID function as
well as the CALL? You need to register the C/C++ function first. The
code should look something like this
macro1 REGISTER.ID("xxx.dll","cfunc1","PPPP")
RETURN(CALL(macro1(parm1,parm2,parm3,parm4)
Save the above Excel macro code as an .xla (add-in).
Put the .dll in your C: "system" folder.
Put the .xla in your XLSTART folder.
Assuming your parameters are correctly set up, it should work.
Lori
Cheers,
Nick
=============================
Public Declare Function nameoffunction Lib "nameofdll.DLL" (ByVal parameter1
as x, ByRef parameter2 as y, etc.) As Long (where long is the return value
of the function)
or
Public Declare Sub nameoffunction Lib "nameofdll.DLL" (ByVal parameter1 as
x, ByRef parameter2 as y, etc.) when no value is returned.
In the paramter list you need to define if the parameter is ByVal or ByRef
and the variable type. Be careful with strings, they are usually ByVal.
Also, if you are expecting a short in C then it must be defined as an int in
VB, an int in C as a long in VB, and more. You can find the translations in
the Help file.
The DLL you are calling must be in your path or must be in the current
folder/directory. The current folder/directory is the directory that you
see when you use the Open or Save buttons. If you change this directory in
between calls to the dll and the dll is not in you path it won't find it.
Hope this helps.
Diane
Nick Brook wrote in message <36DE903D...@bt.com>...