error calling dll in VB

Can anyone give me some help with a call of DLL in VB/excell?



I receive a runtime error '453' which says can't find dll entry point.



Below came from alt-F11 screen in excell.



Public Declare Sub KEN_2 Lib "C:Program FilesMicrosoft Visual StudioMy Projectsken_2KEN_2.dll" Alias _

"_KEN_2@4" (ByVal I As Integer, ByVal J As Integer)



Sub Macro1()

I = 2

Call KEN_2(I, J)

ActiveCell.Value = J

End Sub



DLL source looks like below in Fortran.



subroutine KEN_2(i,j)

!DEC$ ATTRIBUTES STDCALL,DLLEXPORT :: KEN_2

!DEC$ ATTRIBUTES ALIAS:'KEN_2' :: KEN_2

!DEC$ ATTRIBUTES REFERENCE :: i,j

integer*2 i,j

j = i + 1

end subroutine



Thanks for the help.



Ken












Comments

  • I think and I'm sure this is right that you don't declare your function properly, try and declare it with another name.




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories