Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Hibernate via VBA

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hibernate via VBA

use :

sendkeys ^{esc}
sendkeys u
sendkeys {down}{down} ' for my case to get to hibernate
sendkeys {enter}

this should work... working in my case

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Hibernate via VBA

I tried the below but only got a "u" entered into an excel cell.

It seems that the below line is not working:

SendKeys "^{ESC}"

When I enter Ctl+Esc on the keyboard the start menu shows but for some
reason this doesn't work with sendkeys.

Is there another way to hibernate from excel VBA?


"aeroguy" wrote:

use :

sendkeys ^{esc}
sendkeys u
sendkeys {down}{down} ' for my case to get to hibernate
sendkeys {enter}

this should work... working in my case


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Hibernate via VBA

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
  #5   Report Post  
Posted to microsoft.public.excel.programming
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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Hibernate via VBA

Thanks for posting back. Maybe it'll help the next googler.

mcphc wrote:

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


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to close file and hibernate? Eric Excel Discussion (Misc queries) 2 May 4th 10 07:44 PM
Hibernate Button Amos Carver Excel Discussion (Misc queries) 1 June 2nd 09 05:44 PM
Hibernate using Excel macro Rod Armour Excel Programming 0 December 10th 03 07:29 AM


All times are GMT +1. The time now is 03:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"