LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default SendKeys problem

I'm having trouble with the SendKeys command in Excel 2002 (Win2k). I
am trying to send commnands to a Win2k dialogue box (Power Option
Properties), but the SendKeys command "^(TAB)" does not change tabs in
the dialogue box like it does when typed manually on the keyboard.
(According to Excel VBA help, "^(TAB)" = Ctrl+Tab). I have tried
numerous other Sendkeys commands, but none of them act like Ctrl+Tab.
Does anyone know how I can change tabs in a windows dialogue box using
SendKeys? Or how I can get Win2k to interpret SendKeys commands
"correctly"? Failing that, does anyone know how to turn hibernate on
and off using an Excel macro?

Part of my simple script:

Set WshShell = 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 Option
'Properties
Application.Wait Now + TimeValue("00:00:01")
WshShell.SendKeys "{ENTER}", True 'opens Power Option Properties
Application.Wait Now + TimeValue("00:00:02")
WshShell.SendKeys "^{TAB}", True 'problem is here, this does NOT
'switch tabs within the dialogue box!

Any help greatly appreciated ... Many thanks,

Rod Armour
 
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
SendKeys syntax problem VBAvirgin New Users to Excel 2 January 4th 06 04:42 PM
Sendkeys GB[_3_] Excel Programming 0 September 16th 03 10:39 PM
SendKeys and Path Problem rdcord Excel Programming 3 September 11th 03 06:12 PM
SendKeys Ron de Bruin Excel Programming 3 August 25th 03 10:21 PM
sendkeys mark poole Excel Programming 0 July 11th 03 03:47 PM


All times are GMT +1. The time now is 01:20 PM.

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

About Us

"It's about Microsoft Excel"