Yuck! All that code just to retrieve something so simple.
The Environ() function will that and much more.
MsgBox "Network Name = " & Environ("username")
MsgBox "Computer Name = " & Environ("computername")
Search the forum for the keyword ENVIRON and my user name for I have a sample db posted somewhere that will list all of the Environ variables.