Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Hibernate using Excel macro

Hi group,

I'm trying to tell a Win2k machine to boot from hibernate
automatically in the morning, run two programs unattended during the
day, one of them Excel XP, and then shut down in the afternoon. The
problem is that Win2k automatically goes back into hibernatation if it
has no tasks to perform, and unfortunately it does not accept my timed
Excel macros as cause for remaining on, so the computer goes back into
hibernation after just a few minutes. After attempting various
solutions, I have concluded that the answer is to employ a macro to
turn "hibernation" off in Win2k after the computer boots (resumes in
the morning), and then turn it back on before shut down in the
afternoon. I have been trying to access the "Hibernate" tab in Power
Option Properies (Control Panel) from an Excel macro, but that's the
problem. I can get to Power Option Properties using "SendKeys," but
once there, none of the "SendKey" commands act as expected and I can
find no combination that will highlight the Hibernate tab in order to
turn hibernatation off (and back on). For example, SendKeys "^{TAB}"
does NOT act like Ctrl+Tab on the keyboard. Does anyone know how to
send Ctrl+Tab using sendkeys, or call the Power Options Hibernate tab
from an Excel VB macro in order to turn hibernation on and off? If
not, might someone know how to turn hibernatation on and off with
Excel VB by another method?

Part of the code I've been using, but the SendKeys command "^(TAB)"
does not change tabs in the Power Options dialogue box.

Set WshShell = CreateObject("WScript.Shell")
'Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "^{ESC}", True 'presses the Start button
Application.Wait Now + TimeValue("00:00:01")
WshShell.SendKeys "{DOWN}", True 'highlights a link to Power Options
Application.Wait Now + TimeValue("00:00:01")
WshShell.SendKeys "{ENTER}", True 'opens Power Options
Application.Wait Now + TimeValue("00:00:02")
WshShell.SendKeys "^{TAB}", True 'problem is here, this does NOT
switch tabs

Thanks for the help!
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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM


All times are GMT +1. The time now is 11:47 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"