Page 1 of 1

Copy / paste from Excel to multiple fields in browser

Posted: 02 Aug 2018, 13:36
by fortynightsNC
I'm not a programmer and I'm researching this issue for a small business.

They basically need to be able to copy information from a simple Excel spreadsheet to an online form that has multiple fields. My Google searches brought me to Autohotkey and I don't know if t his is something that can be done.

I can provide images of the Excel spreadsheet and the online form if anyone is curious. We'd be willing to pay a fee for someone's time if you can help with this issue, simply because I don't have time to research all of this. Thanks in advance for any direction you can provide!

Re: Copy / paste from Excel to multiple fields in browser

Posted: 02 Aug 2018, 15:25
by TLM
Hi there, yes It's exactly what ahk is designed to do. The Excel part is easy. Does it matter which browser you use?
You should register too :)

Re: Copy / paste from Excel to multiple fields in browser

Posted: 02 Aug 2018, 15:52
by fortynights
OK, I registered. :)

I THINK we have to use Chrome but I'm double-checking with the program manager on this part.

Re: Copy / paste from Excel to multiple fields in browser

Posted: 02 Aug 2018, 16:04
by fortynights
OK, she got back to me. She says the online form works better in Chrome but it does work in IE, but occasionally there are issues "depending on which version of IE you use."

Re: Copy / paste from Excel to multiple fields in browser

Posted: 02 Aug 2018, 20:21
by Vh_
Yes, this is very easy to do using COM with IE and Excel!

I highly recommend checking Joe Glines website for excellent COM learning. This is where I learned a lot of COM. He also has some tools on the site that are very helpful, such as iWB2 learner for getting element names in webpages and then also a tool to help with IE automation.

http://the-automator.com/web-scraping-with-autohotkey/

http://the-automator.com/excel-autohotkey/



Try this Excel COM Example. Have an excel spreadsheet open then run the script. I put a delay between lines to slow it down for the example.
#SingleInstance, Force
XL := ComObjActive("Excel.Application") ;Create an object to the active excel window


XL.Range("A1").Select ;select a specific cell

XL.ActiveCell.Value := "Hello" ;use the active cell
Sleep, 500
XL.ActiveCell.Offset(1,0).Value := "There" ;Offset from active cell by (1 row, 0 column)
sleep, 500
XL.ActiveCell.Offset(1,1).Value := "and over here!" ;Offset from active cell by (1 row, 1 column)
sleep, 500
SomeDataVar := XL.Range("B2").Value ;store the value of a cell as a variable


Msgbox, % SomeDataVar ;see what is in the variable

Please let me know if I can help. I use Excel and IE with COM daily.

Re: Copy / paste from Excel to multiple fields in browser

Posted: 03 Aug 2018, 08:05
by fortynights
OK, thank you so much! We'll do some digging and I'll send any questions we might have. We really appreciate the tips!