Attribute VB_Name = "Global" 'Code for BAS Module: Declare Function LogonUser Lib "advapi32.dll" Alias "LogonUserA" (ByVal lpszUsername As String _ , ByVal lpszDomain As String, ByVal lpszPassword As String, ByVal dwLogonType As Long, _ ByVal dwLogonProvider As Long, phToken As Long) As Long Declare Function ImpersonateLoggedOnUser Lib "advapi32.dll" (ByVal hToken As Long) As Long Declare Function RevertToSelf Lib "advapi32.dll" () As Long