Alternative to SendKeys for field that' not in tab sequence

B

BillyRogers

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
 
R

Rick Rothstein \(MVP - VB\)

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
 
R

Rick Rothstein \(MVP - VB\)

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.

I meant to add to the above... "The TabIndex is assigned sequentially as the
controls are added to the UserForm; however, the TabIndex can be reassigned
by you, at any time, as necessary".

Rick
 
B

BillyRogers

Sorry I don't know if I explained this. The decryption exe is not a program
i wrote. I can't change any of the field properties.

there is a brows button I'm going to try to use that...it will just require
a heck of a lot of sendkeys to navigate to the correct folder.

Thanks,
--
Billy Rogers

Dallas,TX

Currently Using SQL Server 2000, Office 2000 and Office 2003
 
R

Rick Rothstein \(MVP - VB\)

Sorry, I misread your original post. I'm guessing you can't get the original
programmer to change the tab order for you. One thing you can do is see how
many Tab Key presses it takes to go from the Password field to the
Destination field, then use that number in a single SendKeys function call
inside a macro. For example, if it takes 8 Tab Key presses to move from the
Password field to the Destination field, this single line of code (placed in
a macro subroutine) will execute that many Tab Key presses...

SendKeys "{TAB 8}"

Change the 8 to the actual number of Tab Key presses required.

Rick
 
B

BillyRogers

Well the problem is that you can't Tab into the field. the original
programmer left it completely out of the tab sequence.


--
Billy Rogers

Dallas,TX

Currently Using SQL Server 2000, Office 2000 and Office 2003
 
B

Bill Renaud

Peter's suggestion is a good possibility.

The programmer may have specified the accelerator key (Alt+key), but forgot
to add the "&" to the field label, causing the form to look like there is
no accelerator key, when in fact there is one. Try all of the letters in
"Destination folder", or whatever the field is labeled (i.e. Alt+D, Alt+e,
Alt+s, etc.).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top