Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default SendKeys + Dialog

Here is my (broken) attempt at using SendKeys, if you could please help me
fix:

Selection.NumberFormat = "m/d/yyyy"
' not enough if Windows Regional Settings and cell values are both mm/dd/yyyy
before starting, so SendKeys
SendKeys "%o", True ' Format
SendKeys "e", True ' Cells...
' have to hope that the "Numbers" tab is the one showing
SendKeys "{TAB}", True ' focus on datatype
SendKeys "c", True ' already in date format from previous line; only one
C needs to be pressed
SendKeys "{TAB}", True ' focus to textbox
SendKeys "m/d/yyyy", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True ' focus to OK
SendKeys "{ENTER}", True

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200705/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default SendKeys + Dialog

Nevermind, I found a better solution than SendKeys:
Selection.NumberFormat = "m\/d\/yyyy"

I still would like to know what I was doing wrong, though.


undrline wrote:
Here is my (broken) attempt at using SendKeys, if you could please help me
fix:

Selection.NumberFormat = "m/d/yyyy"
' not enough if Windows Regional Settings and cell values are both mm/dd/yyyy
before starting, so SendKeys
SendKeys "%o", True ' Format
SendKeys "e", True ' Cells...
' have to hope that the "Numbers" tab is the one showing
SendKeys "{TAB}", True ' focus on datatype
SendKeys "c", True ' already in date format from previous line; only one
C needs to be pressed
SendKeys "{TAB}", True ' focus to textbox
SendKeys "m/d/yyyy", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True ' focus to OK
SendKeys "{ENTER}", True


--
Message posted via http://www.officekb.com

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 permanently change Dialog Caption while in the Dialog MikeZz Excel Programming 2 July 11th 06 04:53 PM
How to permanently change Dialog Caption while in the Dialog MikeZz Excel Programming 0 July 11th 06 04:14 PM
Sendkeys Jim Excel Programming 1 April 16th 05 06:44 PM
Close Dialog Box with SendKeys Jim May Excel Programming 3 October 4th 04 04:25 PM
control of dialog macro dialog box. on open Gerry Abbott Excel Programming 0 July 22nd 04 05:41 PM


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