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 jun.sh
'ActiveWorkbook.Worksheets()
sh.Activate()
sh.Range("A1").Select()
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?

Thanks,
B-rad

*** Sent via Developersdex http://www.developersdex.com ***

Re: Calling visual basic dll from excel vba by Paul

Paul
Tue Jul 15 10:08:54 CDT 2008

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.

"B-rad" <anonymous@devdex.com> wrote in message
news:eZ3Swjo5IHA.1468@TK2MSFTNGP05.phx.gbl...
>
> 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 jun.sh
> 'ActiveWorkbook.Worksheets()
> sh.Activate()
> sh.Range("A1").Select()
> 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?
>
> Thanks,
> B-rad
>
> *** Sent via Developersdex http://www.developersdex.com ***