View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
mcphc mcphc is offline
external usenet poster
 
Posts: 44
Default Hibernate via VBA

After a lot of hunting and trail and error I've managed to get it to work,
here it is:

Shell "C:\WINDOWS\System32\rundll32.exe powrprof.dll,SetSuspendState", vbHide

Pretty simple in the end

"Dave Peterson" wrote:

I'd use google to search one of the Visual Basic newsgroups for hybernate.
Maybe there's some API calls that you can use.

If you don't find anything, I'd post in one of the VB groups--but be sure to
tell them you want to run it in excel's VBA--include your version of windows and
your version of excel.

Good luck.

mcphc wrote:

Is there a way to hibernate a computer via Excel VBA?

I tried something like SendKeys "^{ESC}u", True
to get the shutdown box up but it doesn't work.

Any other ideas?

Thanks


--

Dave Peterson