Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on Defining a Length in SendKeys Command

Status
Not open for further replies.

monicamarie

Technical User
Dec 7, 2012
2
US
Hello,

I am trying to edit part of a macro code in Excel that works with Attachmate (shown below). The CardNumber variable is is an Excel worksheet and always contains 19 digits. I want Attachmate to only send the first 16 characters of that string for each loop. If that is possible, can someone help me to make that edit in the code?

Thank you in advance!

Do While Sess0.Screen.OIA.Xstatus <> 0: Loop
CardNumber = ActiveCell.Value
Sess0.Screen.SendKeys ("<Clear>")
Do While Sess0.Screen.OIA.Xstatus <> 0: Loop
Sess0.Screen.SendKeys ("RR00<Enter>")
Do While Sess0.Screen.OIA.Xstatus <> 0: Loop
Sess0.Screen.SendKeys (CardNumber)
Do While Sess0.Screen.OIA.Xstatus <> 0: Loop
Sess0.Screen.SendKeys ("D<Enter>")
Do While Sess0.Screen.OIA.Xstatus <> 0: Loop
Customer_Number = Sess0.Screen.GETSTRING(5, 8, 14)
Do While Sess0.Screen.OIA.Xstatus <> 0: Loop
 
I want Attachmate to only send the first 16 characters of that string ...
Code:
left(CardNumber,16)


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I can't believe it was that simple. Thank you so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top