I've written a very simple DLL that I want to run in Excel VBA. When I run it, I get error msg 453 "Can't find DLL entry point". I'm pretty sure that Excel finds the DLL. If I move it, I get the msg "Can't find DLL". I read somewhere that it has something to do with 32-bit and 16-bit, but I'm working with Delphi 7 and Excel 2002. I am lost. What can I do?
DLL
function DoubleTime(Antal: Integer): Integer; stdcall;
var
a, b: integer;
begin
b:=0;
for a:=1 to Antal do
begin
b:=b+a;
end;
Result:=b;
end;
VBA Code
Declare Function DoubleTime Lib "ExcelDLL" (ByVal Antal As Integer) As Integer
Sub test()
Range("a1".Value = DoubleTime(1000)
End Sub
DLL
function DoubleTime(Antal: Integer): Integer; stdcall;
var
a, b: integer;
begin
b:=0;
for a:=1 to Antal do
begin
b:=b+a;
end;
Result:=b;
end;
VBA Code
Declare Function DoubleTime Lib "ExcelDLL" (ByVal Antal As Integer) As Integer
Sub test()
Range("a1".Value = DoubleTime(1000)
End Sub