Error when Playing Script for WriteUIA using Excel data

Getting started -basics for starting with WinTask

Error when Playing Script for WriteUIA using Excel data

Postby struttin on Thu Jan 22, 2015 11:48 am

Hello!
I am trying to get WinTask to automate a form filling inside of a Windows program. I have used SpyMode to select the appropriate fields, but I am having trouble using the variables in those expressions. I basically watched these two tutorials and tried to put together the lessons in both, but I am missing a something somewhere, http://www.wintask.com/tutorials/exceld ... part2.html and https://www.youtube.com/watch?v=7DcYzZGn-0w

Here is my code:
Code: Select all
Dim name$(100)
Dim description$(100)
Dim serial$(100)
Dim mac$(100)
Dim location$(100)
Dim ip$(100)

ReadExcel ("data.xlsx","A2:A61", name$())
ReadExcel ("data.xlsx","B2:B61", description$())
ReadExcel ("data.xlsx","C2:C61", serial$())
ReadExcel ("data.xlsx","D2:D61", mac$())
ReadExcel ("data.xlsx","E2:E61", location$())
ReadExcel ("data.xlsx","F2:F61", ip$())

i=0
repeat
UseWindow("TIGERPAW11.EXE|Button|Asset items|11",1)
   ClickMouse(Left,Down,8,10)
   MoveMouse(6,9)
   ClickMouse(Left,Up,6,9)
WriteUIA("[APP='Tigerpaw11.exe',CLASS='ThunderRT6TextBox',AUTOID='9']", name$())
WriteUIA("[APP='Tigerpaw11.exe',CLASS='ThunderRT6TextBox',AUTOID='8']", description$())
WriteUIA("[APP='Tigerpaw11.exe',CLASS='ThunderRT6TextBox',AUTOID='10']", serial$())
WriteUIA("[APP='Tigerpaw11.exe',CLASS='ThunderRT6TextBox',AUTOID='11']", mac$())
WriteUIA("[APP='Tigerpaw11.exe',CLASS='ThunderRT6TextBox',AUTOID='12']", location$())
WriteUIA("[APP='Tigerpaw11.exe',CLASS='ThunderRT6TextBox',AUTOID='4']", ip$())

UseWindow("TIGERPAW11.EXE|ABSActiveBarDockWnd|DockTop",1)
   ClickMouse(Left,Down,152,57)
   ClickMouse(Left,Up,152,57)

UseWindow("TIGERPAW11.EXE|ABSActiveBarDockWnd|DockTop",1)
   ClickMouse(Left,Down,70,42)
   ClickMouse(Left,Up,70,42)
i=i+1
until name$(i)=""


and the errors (I was unable to copy and paste the error log, so here is a sceenshot):
http://screencast.com/t/EIKiKydFtJQ

I know I am probably just missing something small, but I don't know what!

Any help is greatly appreciated. Thank you!
struttin
 
Posts: 1
Joined: Thu Jan 22, 2015 11:34 am

Re: Error when Playing Script for WriteUIA using Excel data

Postby TechSupport on Fri Jan 23, 2015 9:29 am

Hello,

You have compilation errors, it's due to the WriteUIA lines, WriteUIA writes just one string, not an array, so thoses lines:
WriteUIA("[APP='Tigerpaw11.exe',CLASS='ThunderRT6TextBox',AUTOID='9']", name$())
must be replaced by
WriteUIA("[APP='Tigerpaw11.exe',CLASS='ThunderRT6TextBox',AUTOID='9']", name$(i))

name$() is all the array, name$(i) is the ith element of name$

Regards.
WinTask Tech Support
TechSupport
 
Posts: 805
Joined: Thu Nov 16, 2006 9:58 am


Return to Getting started

Who is online

Users browsing this forum: No registered users and 1 guest