I have a problem with my compiled code. When the code is running under my environment and I can step through it, I have no worries, but once I compile the code into a DLL, the following function returns nothing instead of the User's Domain. Here is the code, anyone with a clue?
'Function that grabs the Domain the User's NT Login Account is on
Public Function Domain() As String
Dim wshNet As Object
Set wshNet = CreateObject("WScript.Network")
On Error GoTo errBadNetwork
Domain = wshNet.UserDomain
Dim i As Long
Set wshNet = Nothing
Domain = "Unavailable"