Expand|Select|Wrap|Line Numbers
- 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.doSomething
- MsgBox("Hello")
- End Sub
- End Class
"doSomething" sub routine could be accessed/called from an excel vba (by
first referencing the tlb file).
My excel vba is as follows:
Expand|Select|Wrap|Line Numbers
- Private moTemp As mydll.IDemo
- Sub trial()
- moTemp.doSomething
- End Sub
but when I run the "trial" macro I get the following error:
"Run-time error '91': Object variable or With block variable not set"
Have I done everything I need to in vb, and if so does anyone know if the call from excel vba is correct?
Thanks in advance,