I'm writing a COM DLL for use in VBA using VB.Net. Here it is, in all its glory:
Public Class CompPl32
<Runtime.InteropServices.ComVisibleAttribute(True)>
Public Function MyUncompress(SrcSt As String) As Integer
Return 0
End Function
End Class
When I look for this in Excel's VBA editor, I find the dll/tlb with the projectname/rootnamespace "CompPL'. When I refer to it in code though, it's...
Dim pl As CompPl.CompPl32
Which is kind of ugly when you're trying to match the API of non.Net COMs. Is there a way to remove one level of the naming so it's either just CompPl or CompPl32? I tried putting it in a Module but you can't import just the project namespace, it has to have a class name in VBA, and changing the root namespace to nothing results in a blank string that is confusing.
Imports Namespacestatement for the Excel and VBA libraries. This feature does not preclude from fully qualifying the reference. If you are using multiple libraries with classes that have the same name as the default imported ones, you have no choice but to do so. i.e.Dim wdApp as Word.ApplicationandDim xlApp as Excel.Application.