Copy from Excel Spreadsheet and Paste to Web-based program

Get help with using AutoHotkey and its commands and hotkeys
zawzaw82
Posts: 1
Joined: 06 Feb 2019, 18:03

Copy from Excel Spreadsheet and Paste to Web-based program

06 Feb 2019, 22:09

Hi,

I am a new to AHK and require an assistance to write a script for sending the excel cells data to web-based program.
Currently, manual entry is done and takes ages to enter hundreds of data entry. I have VBA script to copy the cell range but require AHK script to web program. Both the excel spreadsheet and web program be active at the same time.

What I need is that once the data from excel cells range is copied, I will go and point the cursor on the first cell of the web program. There are total of 6 cells in a row. The Tab button is required to move to next one. After the sixth cell, it moves to second row. The rows can be from 10 to 500.

Can anyone please guide me the right direction?

Thanks
ZZ
User avatar
Thoughtfu1Tux
Posts: 102
Joined: 31 May 2018, 23:26

Re: Copy from Excel Spreadsheet and Paste to Web-based program

07 Feb 2019, 01:40

There are a lot of different options to pick from when it comes to automating browsers. If you do a search on the scripts showcase forum you will find a ton of different options.

I personally use ExcelCOM for copying from an excel Sheet and saving that data as variables, and then use Selenium to Automate Chrome to input that information into an online government billing site because doing it by hand is a surefire way of going insane.

Joe Glines has a superb tutorial on Selenium on his site, and I found everything there to do everything I needed to in Selenium. He has a forum post about it in the scripts forum somewhere, but I don’t have the saved, it has some more resources in the comment section.

http://the-automator.com/cross-browser-web-scraping-with-autohotkey-and-selenium/

A great starting place for Excel COM through hotkey can be found here: https://autohotkey.com/board/topic/69033-basic-ahk-l-com-tutorial-for-excel/
User avatar
jethrow
Posts: 188
Joined: 30 Sep 2013, 19:52
Location: Iowa

Re: Copy from Excel Spreadsheet and Paste to Web-based program

07 Feb 2019, 02:07

Here's a quick example:

Code: Select all

sheet := excelSetup()
document := ieSetup()

MsgBox Enter values in Excel Cells B1-B3. Once complete, press OK to populate webpage ...

document.getElementsByName("username")[0].value := sheet.Range("B1").Value
document.getElementsByName("password")[0].value := sheet.Range("B2").Value
document.getElementById("keywords").value := sheet.Range("B3").Value


excelSetup() {
  xl := ComObjCreate("Excel.Application")
  xl.Workbooks.Add()
  sheet := xl.ActiveSheet
  sheet.Range("A1").Value := "User:"
  sheet.Range("A2").Value := "Passwd:"
  sheet.Range("A3").Value := "Search:"
  xl.Visible := 1
  return xl.ActiveSheet
}

ieSetup() {
  wb := ComObjCreate("InternetExplorer.Application")
  wb.Navigate("https://www.autohotkey.com/boards/ucp.php?mode=login")
  wb.Visible := true
  while wb.busy
    sleep 1000
  return wb.document
}
https://autohotkey.com/board/topic/5698 ... ntry381256
https://autohotkey.com/board/topic/47052-basic-webpage-controls-with-javascript-com-tutorial/

Return to “Ask For Help”

Who is online

Users browsing this forum: lexikos, rifqii_, Smile_ and 48 guests