I'm looking for a way to put my notebook [Win7] into hibernation via VBA [Excel 2010]. I was searching for a solution but couldnt find a handy one.
I was playing with the SendKeys
method but no luck. Then the Shell "C:\WINDOWS\System32\rundll32.exe powrprof.dll,SetSuspendState", vbHide
gave me Compile error: Invalid outside procedure
message. The Function ExitWindowsEx
gives only the choices to log off, shut down and reboot but no hibernation as far as I know. Thank you for your help in advance.
Hibernate Win7 via VBA [Excel]?
679 Views Asked by Bernat At
1
I've just successfully hibernated my comp. Here is the magnificent code:
Some comments said that its better going with the
SetSuspendState
than the PowerState one.Have fun hibernating your machines via VBA! Yaay!