Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Visual Basic 2008 dll & Excel VBA code

24 views
Skip to first unread message

bjdesa

unread,
Jun 3, 2010, 4:45:03 PM6/3/10
to
Yes I have been trying to call the function MULT in the Dll file
called ClassLibrary1.dll

I compiled the Visual Basic 2008 DLL for example

Public Class Class1
Public Shared Function MULT (ByVal ARG1 As Double, ByVal ARG2 As
Double) As Double
MULT = ARG1 * ARG2
End Function
End Class

Then from VBA in Excel

Public Declare Function MULT Lib "E:\Visual Studio 2008\Projects
\ClassLibrary1\ClassLibrary1\bin\Release\ClassLibrary1.dll" (A1 As
Double, A2 As Double) As Double

When I try and test it using

Sub test()
Dim A1 As Double
A1 = MULT (4.5, 3.6)
End Sub

It errors off with Run-time error 453 Can’t find DLL entry point MULT

I am sure there must be an error on Visual Basic 2008 side. So what am
I missing?

Michael Cole

unread,
Jun 3, 2010, 10:37:09 PM6/3/10
to
bjdesa expressed precisely :

[SNIP]

> I am sure there must be an error on Visual Basic 2008 side. So what am
> I missing?

Wrong newsgroup - this is for VB6 and earlier. You should ask any
questions about VB.Net in a dotNet group.

--
Michael Cole


0 new messages