Message 1 of 3
VB.net_v03 . tlb

Not applicable
02-03-2005
03:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I made a simple test Class in vb.Net which
works fine in .net as a Member or compiled
Reference.
Using the command line [regasm] I successfully
registered the dll and created a .tlb, which
is now available as a Reference in VBA.
I can create a new instance of the Class in vba
but none of the properties are available in the
browser or via intellisence. I don't get an error when
the class is instantiating but if I force in a property
I get a runtime error, which is expected since they are
not there.
Any ideas? Is it Possible?
Thanks,
Paul
'***Start Code
'Imports System.Math
'Commented out in compiled version for VBA
'Now the c = a^2 + b^ Theorem
Public Class clsPythagoreanTheorem
Private dblA As Double
Private dblB As Double
Private dblC As Double
Public Property dblAValue() As Double
Get
Return dblA
End Get
Set(ByVal Value As Double)
dblA = Value
End Set
End Property
Public Property dblBValue() As Double
Get
Return dblB
End Get
Set(ByVal Value As Double)
dblB = Value
End Set
End Property
'For testing only..Actual version would have Set..
Public ReadOnly Property dblCValue() As Double
Get
dblC = fCalcTheorem()
Return dblC
End Get
End Property
Private Function fCalcTheorem()
'Comment out math Namespace can't use sqrt
'fCalcTheorem = Sqrt((dblA ^ 2) + (dblB ^ 2))
fCalcTheorem = ((dblA ^ 2) + (dblB ^ 2))
End Function
End Class
'***End Code