I've created the following dll in vb 2008.
_______________ _______________ _______________ ______________
Public Interface IDemo
Sub doSomething()
End Interface
Public Class implementIDemo
Implements IDemo
Dim varAsInterface As IDemo = New implementIDemo( )
Dim varAsClass As implementIDemo = New implementIDemo( )
Private Sub doSomething() Implements IDemo.doSomethi ng
MsgBox("Hello")
End Sub
End Class
_______________ _______________ _______________ ______________
I then used tlbexp.exe, gacutil.exe, regasm,exe, and sn.exe so that the
"doSomethin g" sub routine could be accessed/called from an excel vba (by
first referencing the tlb file).
My excel vba is as follows:
_______________ _______________ _______________ ______________
Private moTemp As mydll.IDemo
Sub trial()
moTemp.doSometh ing
End Sub
_______________ _______________ _______________ ______________
Excel VBA seems to recognize class and subfunction as I'm typing them,
but when I run the "trial" macro I get the following error:
"Run-time error '91': Object variable or With block variable not set"
Any ideas?
Thanks in advance,
*** Sent via Developersdex http://www.developersdex.com ***
_______________ _______________ _______________ ______________
Public Interface IDemo
Sub doSomething()
End Interface
Public Class implementIDemo
Implements IDemo
Dim varAsInterface As IDemo = New implementIDemo( )
Dim varAsClass As implementIDemo = New implementIDemo( )
Private Sub doSomething() Implements IDemo.doSomethi ng
MsgBox("Hello")
End Sub
End Class
_______________ _______________ _______________ ______________
I then used tlbexp.exe, gacutil.exe, regasm,exe, and sn.exe so that the
"doSomethin g" sub routine could be accessed/called from an excel vba (by
first referencing the tlb file).
My excel vba is as follows:
_______________ _______________ _______________ ______________
Private moTemp As mydll.IDemo
Sub trial()
moTemp.doSometh ing
End Sub
_______________ _______________ _______________ ______________
Excel VBA seems to recognize class and subfunction as I'm typing them,
but when I run the "trial" macro I get the following error:
"Run-time error '91': Object variable or With block variable not set"
Any ideas?
Thanks in advance,
*** Sent via Developersdex http://www.developersdex.com ***
Comment