Hello,
I'm a beginner in programming Vb.net (I've changed from VB6). My Problem is, to create a VB.Net dll, wich I can use in Excel. My IDE is VS 2005 and have tried the following Code.
<ComClass(hbxman2.ClassId, hbxman2.InterfaceId, hbxman2.EventsId)> _
Public Class hbxman2
#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
Public Const ClassId As String = "feed2519-7960-4730-9d98-1de43a395f09"
Public Const InterfaceId As String = "096c56e9-7ac7-49bd-9743-505a065ca135"
Public Const EventsId As String = "5bde0f5d-5630-4046-8d21-a83d3711ddaa"
#End Region
' A creatable COM class must have a Public Sub New()
' with no parameters, otherwise, the class will not be
' registered in the COM registry and cannot be created
' via CreateObject.
Public Sub New()
MyBase.New()
End Sub
<System.Runtime.InteropServices.DispId(1)> Public Sub Test(ByVal strmsg As String)
Call MsgBox(strmsg)
End Sub
End Class
This is, if I choose Com - Class in VS 2005. I also have created an Interface for com myself, but the result is every time the same: I can add a reference to the dll, i cann see the Function in the Excel - Object - Explorer, but I can't use it, it occurs an runtime Error (automation error). IN VB 6 i can use it without any Problems. What's my mistake?
I've also tried to use gacutil/i, but the result was the same
Thanks Andy