A
AlexT
Folks
I'm trying to logoff the current Windows session from VBA.
I have looked into MSDN and came up with the following code
-----------------------------------------------------------------------
Private Const EWX_LogOff As Long = 0
Private Declare Function ExitWindowsEx Lib "user32" _
(ByVal dwOptions As Long, _
ByVal dwReserved As Long) As Long
Private Declare Function GetLastError Lib "kernel32" () As Long
Public Sub DOLogoff()
ExitWindowsEx (EWX_LogOff), &HFFFF
MsgBox "ExitWindowsEx's GetLastError " & GetLastError
End Sub
-----------------------------------------------------------------------
For some reason calling DOLogoff doesn't work, although
ExitWindowsEx returns 0 (no error ?)
Any idea ?
Regards
--alexT
I'm trying to logoff the current Windows session from VBA.
I have looked into MSDN and came up with the following code
-----------------------------------------------------------------------
Private Const EWX_LogOff As Long = 0
Private Declare Function ExitWindowsEx Lib "user32" _
(ByVal dwOptions As Long, _
ByVal dwReserved As Long) As Long
Private Declare Function GetLastError Lib "kernel32" () As Long
Public Sub DOLogoff()
ExitWindowsEx (EWX_LogOff), &HFFFF
MsgBox "ExitWindowsEx's GetLastError " & GetLastError
End Sub
-----------------------------------------------------------------------
For some reason calling DOLogoff doesn't work, although
ExitWindowsEx returns 0 (no error ?)
Any idea ?
Regards
--alexT