Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to reboot a PC using VBA code
Thanks Kevin |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the help Chip
I plan on using this in a macro that will be restricted (by password) for my use only. No other users will experience the reboot. The macro will launch one of two .reg files that will restrist or unrestrict various features, e.g., start/run, file options, find, etc. To take affect the PC must be rebooted. I thought since the macro was running anyway, why not have it reboot the PC too I'm doing this to safeguard my PC from the children Kevin |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Kevin;
Sub Reboot() With CreateObject("Shell.Application") .ShutdownWindows End With End Sub MP "Kevin" a écrit dans le message de ... Is it possible to reboot a PC using VBA code? Thanks. Kevin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I recover a file not saved - auto reboot? | Excel Discussion (Misc queries) | |||
ribbon changed after reboot | Excel Discussion (Misc queries) | |||
autorecover doesn't work reliably during a forced reboot | Excel Discussion (Misc queries) | |||
Excel ALWAYS locks up-little white cross-& I need to reboot HELP! | Excel Discussion (Misc queries) | |||
PC Reboot on Excel Launch | Excel Discussion (Misc queries) |