Jump to content

Mysterious Tabbing when sending variables


Guest jocasio
 Share

Recommended Posts

Guest jocasio

Hey All:

I'm very new to AutoIT and I'm trying to create a Script that copies data from an excel spreadsheet, loads the data into variables, then runs an application to fill in the data. This is a Loan entry program we have and I'm trying to automate the entry of data. So my excel spreadsheet has about 20 columns. I'm able to load the data into the variables fine, but when I go to the applications to load the customer info, when I perform a oAutoIT.Send variableName, it sends the data, but also seems to send a Tab. I actually have to tab through and send each of the variables, so this would not be a problem if after sending each variable, it tabbed. The only problem is it's not consistant with how it does this. Is there a way (besides setting the flag to 1 - I tried that already) to stop the tabbing. Interesting enough the vbscript shell.sendkeys does the same thing. I also tried copying the variable back onto the clipboard and then pasting, but it's empty.

Any help would be greatly appreciated

Thanks

jocasio

Link to comment
Share on other sites

Guest jocasio

Thanks for the reply. I'm able to copy the data to to my variables, the problem isn't with the excel spreadsheet however. It's when I activate my third pary application. When I send each of the variables to the textboxes in this app, there seems to always be a TAB somewhere. I just want to be able to send just the data and no other characters (carriage returns, etc), and want to manually tab through the fields. We are currently using an application called Macro Express, but it's not robust enough.

THanks

jocasio

Link to comment
Share on other sites

Does the AutoItX.dll contain a StringStripWS()/StringStripCR() function?

I can't open it up right now, I don't have that particular version with me.

Edit: Nevermind. I do have the AutoItX.dll help file. No, it doesn't. Does VB have this ability to strip out whitespace and carrage returns? I think the tab is considered a whitespace character.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

@jocasio

I assume you are using AutoItX.dll right

Just remove the last char

sString = Left(sString ,Len(sString)-1)

Instead of using "Send" I would use "ControlSetText" or "ControlSend".

NOTE: copying data to the clipboard is not the best solution, is not fail proof and is slow.

The best solution is to use Excel VBA with AutoItX.dll and you will not have this issue.

Edited by bshoenhair
Link to comment
Share on other sites

Guest jocasio

bshoenhair:

Thanks for the reply. Unfortunately I cannot use the ControlSend because my controls do not show up having ids in the AutoIT window Info viewer. I am trying the VBA and it seems to be working so far. I will continue this and let you know how it goes.

THanks

jocasio

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...