Copy result from IE to excel

Get help with using AutoHotkey and its commands and hotkeys
inseption86
Posts: 42
Joined: 19 Apr 2018, 00:24

Copy result from IE to excel

20 Apr 2018, 06:11

Hello, sorry my english, i need ahk Copy result from IE to excel. Example https://ibb.co/hiBgWn

Code: Select all

SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

$^1::
Setkeydelay, 35

FileSelectFile, Path, 3, , Open Excel File, Excel File (*.xls; *.xlsx)
if Path =
	ExitApp
Xl := ComObjCreate("Excel.Application")
Xl.Workbooks.Open(Path) ;open an existing file
Xl.Visible := True
if Errorlevel
{
	MsgBox, % "Error opening excel file! Exiting..."
	ExitApp
}

Sheet_Titles =
global Sheet_To_Calculate := 0 
loop, % xl.Sheets.Count
	Sheet_Titles .= A_Index . ": " . xl.Sheets(A_Index).Name . "`n"
While Sheet_To_Calculate < 1 || Sheet_To_Calculate > xl.Sheets.Count || !IF_Integer(Sheet_To_Calculate)
	inputbox, Sheet_To_Calculate, % Xl.ActiveWorkbook.Name, %Sheet_Titles%, , , , , , , , 1
if ErrorLevel
	ExitApp

global Current_Row := -1
While Current_Row < 1 || !IF_Integer(Current_Row)
	inputbox, Current_Row, % Xl.ActiveWorkbook.Name, % "Enter the row to start on.", , , , , , , , 2
if ErrorLevel
	ExitApp


while Xl.Sheets(Sheet_To_Calculate).Range("B" . Current_Row).Value != ""
{
	
B_stored := Xl.Sheets(Sheet_To_Calculate).Range("B" . Current_Row).Value
	
	
	
ControlFocus,, ahk_class IEFrame
Sleep 550
	
	
Click, 205, 285, 2
Sleep 150
Send %B_stored%
send {enter}
Sleep 2000
		
; Move to the next row
	Current_Row++
}

MsgBox, % "Done! :)"
ExitApp

IF_Integer(check_this)
{
	if check_this is not integer
		return false
	else
		return true
}

return

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], justAnotherUser, Sweetins, TAC109, TheBeginner and 199 guests