Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when loading DLL in Excel?

Status
Not open for further replies.

josefl

Programmer
Nov 29, 2002
12
SE
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
 
Go to D7 helpfile and look for how to create a DLL

HTH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top