View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default vba code to reboot

Kevin,

You can use the ExitWindowsEx API function to do this, but I
would STRONGLY recommend that you do not do this. Users will not
be happy. Just out of curiosity, why do you need to do this?

Declare Function ExitWindowsEx Lib "user32" _
(ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Const EWX_REBOOT = 2

Sub AAA()
ExitWindowsEx EWX_REBOOT, 0
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Kevin" wrote in message
...
Is it possible to reboot a PC using VBA code?

Thanks.


Kevin