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

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, ... part2.html and

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$())

UseWindow("TIGERPAW11.EXE|Button|Asset items|11",1)
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$())


until name$(i)=""

and the errors (I was unable to copy and paste the error log, so here is a sceenshot):

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

Any help is greatly appreciated. Thank you!
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


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$

WinTask Tech Support
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