Calling visual basic dll from excel vba



Hello Everyone,

I'm having a problem using excel vba to call the following dll code
which was created as a "Class Library" using Visual Basic 2008 Express
Edition (note: "Class Library" was the only project choice that I saw
that created a dll).
Public Class Class1
Public Sub a1_home_cell(ByVal jun As Excel.Workbook)

MsgBox("You're In!")
' returns each sheet to the home position

Dim sh As Excel.Worksheet
'Dim jun As Excel.Workbook

For Each sh In
Next sh

End Sub
End Class

However, when I attempt to call it from an excel 2000
vba sub routine as follows:

Public Declare Sub a1_home_cell Lib "C:\Documents and Settings\b-rad\My
Documents\Visual Studio 2008\Projects\junk\junk\obj\Release\junk.dll"
(current_workbook As Workbook)

Sub attempt5()
Call a1_home_cell(ActiveWorkbook)
End Sub

I get an error stating:
"Run-time error ‘453’:
Can’t find DLL entry point . . ."

From the messagebox I placed at the beginning of the dll, I see that,
just as the error message states, its not even getting into the dll.
Any ideas?




Paul G. Tobey [eMVP]

I think you've posted to the wrong group. This group, as you can see by the
name, microsoft.public.dotnet.framework.***compactframework*** is about the
..NET Compact Framework, running on Windows CE, not desktop Windows. You'll
get better results posting to an appropriate group.

Paul T.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question