View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default Alternative to SendKeys for field that' not in tab sequence

It's not in the correct tab sequence because of when it was added to the
UserForm. The TabIndex property controls the order the controls will be
visited in when the Tab Key is pressed. Select the TextBox for the Password
and see what its TabIndex number is, then select the control for the
Destination Folder and set its TabIndex to one more than the value you got
from the Password's control. Tabbing should then work as you want it to.

Rick


"BillyRogers" wrote in message
...
I'm trying to build a program in Excel that runs a decryption program
that's
on about 70 CD's we receive each month. the user has to put the cd in
the
tray , run the decryption exe file on the disk and enter the password and
destination folder.

there's just one problem. The destination field is not in the tab
sequence.
You have to actually click the field to enter the destination folder.

Is there someway to automate this?



CloseDefaultDiscTray

Shell """D:\CompanyName""", vbMaximizedFocus


SendKeys "+{TAB}", True ' can't shift tab into destination field...not
in
tab sequence.!!!!!!


SendKeys "C:\Documents and Settings\brogers\Desktop\DecryptionTest"

SendKeys "{TAB}"

SendKeys "Password", True

SendKeys "{Enter}"


--
Billy Rogers

Dallas,TX

Currently Using SQL Server 2000, Office 2000 and Office 2003