Would this be possible in VBA?
Howdy Tom, try the following on for size:<pre>
Private Declare Function ExitWindowsEx Lib "user32.dll" _
(ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, ByVal _
lpWindowName As String) As Long
Public Sub LogOff()
Dim wb As Workbook
LockWindowUpdate FindWindow("xlMain", vbNullString)
For Each wb In Application.Workbooks
If wb.Name<> ThisWorkbook.Name Then wb.Close False
Next wb
ExitWindowsEx 0, 0
End Sub</pre>
Works well in my environment.
_________________
Cheers,<font size=+2><font color="red">
Nate<font color="blue"> Oliver</font></font></font>
This message was edited by nateo on 2002-12-18 19:13