Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2007

Tip: Looking for answers? Try searching our database.

Hibernate via VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mcphc - 16 May 2007 09:59 GMT
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
aeroguy - 16 May 2007 12:04 GMT
use :

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

this should work... working in my case
mcphc - 16 May 2007 12:41 GMT
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?

> use :
>
[quoted text clipped - 4 lines]
>
> this should work... working in my case
Dave Peterson - 16 May 2007 14:09 GMT
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.

> Is there a way to hibernate a computer via Excel VBA?
>
[quoted text clipped - 4 lines]
>
> Thanks

Signature

Dave Peterson

mcphc - 18 May 2007 11:01 GMT
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

> I'd use google to search one of the Visual Basic newsgroups for hybernate.
> Maybe there's some API calls that you can use.
[quoted text clipped - 13 lines]
> >
> > Thanks
Dave Peterson - 18 May 2007 13:06 GMT
Thanks for posting back.  Maybe it'll help the next googler.

> After a lot of hunting and trail and error I've managed to get it to work,
> here it is:
[quoted text clipped - 24 lines]
> >
> > Dave Peterson

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.