Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inputting data from excel into text field.
#1
Hi guys,

I need Quick Macros to be able to use data from several columns in excel to multiple text fields on a web form.

How do I program the macro to do this? The macro should use use a different row on each submission.

Also, how does the the macro interact with selecting local files from a directory? I need to be able to upload multiple different files each time the macro is run.

Any help is appreciated.. thanks ! Smile
#2
This is from Collected QM apps, functions, samples
Macro ExcelToWebForm
Code:
Copy      Help
;Gets data from Excel (must be at least 3 columns) and
;populates 3 fields in Google advanced search page.
;Repeats for each row.

ExcelSheet es.Init
ARRAY(str) a
es.CellsToArray(a "A:C")

int w=win(" Internet Explorer")
act w

Htm el
int row
for row 0 a.len ;;for each row
,el=htm("INPUT" "as_q" "" w 0 0 0x221 5)
,el.SetText(a[0 row])
,el=htm("INPUT" "as_epq" "" w 0 3 0x221)
,el.SetText(a[1 row])
,el=htm("INPUT" "as_eq" "" w 0 5 0x221)
,el.SetText(a[2 row])
,1
,el=htm("INPUT" "submit" "" w 0 12 0x521)
,;el.Click
,;15 I
,;3
,;web "Back"
,

The same for any web browser:
Macro Macro2703
Code:
Copy      Help
;Gets data from Excel (must be at least 3 columns) and
;populates 3 fields in Google advanced search page.
;Repeats for each row.

ExcelSheet es.Init
ARRAY(str) a
es.CellsToArray(a "A:C")

int w=win("Google Advanced Search - Mozilla Firefox" "MozillaWindowClass")
;int w=win("Google Advanced Search - Google Chrome" "Chrome_WidgetWin_1")
;int w=win("Google Advanced Search - Internet Explorer" "IEFrame")
act w

int row
for row 0 a.len ;;for each row
,;select the first field
,Acc k.Find(w "TEXT" "all these words:" "" 0x3091 3)
,k.Select(1)
,;if difficult to create this code for your web page, delete this code and add code to select with keyboard or mouse
,
,key CaX (a[0 row]) T
,key CaX (a[1 row]) T
,key CaX (a[2 row])
,
,;here you can add code to select files. Will need to automate the file selection dialog, probably with key too.
,


Forum Jump:


Users browsing this thread: 1 Guest(s)