Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Arrays and pasting

$
0
0
Hello :)

I was hoping someone could help me with arrays.

Essentially I'm trying to copy eight different cells from Excel, adjacent to one another and paste them into eight different fields of a web form.

I made a start on copying from Excel:
[ autoit ]      
$oExcel = ObjGet("","Excel.Application") WinWaitActive("TeamDataSheet") $oExcel.Visible = 1 ;First Name WITH $oExcel.activesheet .range("A12:A12").copy EndWith ;Last Name WITH $oExcel.activesheet .range("B12:B12").copy EndWith MsgBox (0,"","All done")

And it copies the first field, which is immediately overwritten by the second. I read about Arrays but I wasn't quite sure how to get data copied from an Excel Application added onto the array.

Then, I'm trying to paste this into fields in an Internet Explorer form:
[ autoit ]      
#include <IE.au3> WinWaitActive("Active Team Sheet") $oIE = _IEAttach("Active Team Sheet") $oForm = _IEFormGetObjByName($oIE, "form1") $gridID_fn = "GridViewStudents$ctl04$txtStudentName" $gridID_ln = "GridViewStudents$ctl04$txtLastName" ;First Name $newfn = Send("^V") $o_fn_Text = _IEFormElementGetObjByName($oForm, $gridID_fn) _IEFormElementSetValue($o_fn_Text, $newfn) ;Last Name $newfn = Send("^V") $o_ln_Text = _IEFormElementGetObjByName($oForm, $gridID_ln) _IEFormElementSetValue($o_ln_Text, $newln) MsgBox (0,"","All done")

The functions do work individually pasting the correct information in it's assigned box in the form, but scaling it up from one seems to have me scratching my head. Should I try and delay each step for it to finish and loop back?

I've created them in different files, I'm not sure whether it'd be best to have them as one file and to then try and copy each cell to a different variables in an array.

I've got the
[ autoit ]      
WITH $oExcel.activesheet .range("A12:A12").copy
I'm just not sure how to convert Excel data into an array.

Many thanks in advance

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>