>Is there a way to do lets say the following
>Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
>
>but release the dll after you have retrieved it because it seems to be sucking up memory
You need to wrap this functionality into a class and release the class (set x = Nothing) when you are done.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com