1

Тема: AHK: Вставка найденной информации в эксель

Копирование из excel в ie и найденную информацию необходио скопировать обратно в соседний столбец.  https://ibb.co/hiBgWn


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

2 (изменено: svoboden, 2018-04-23 06:30:03)

Re: AHK: Вставка найденной информации в эксель

В файл CSV не проще заносить данные с веб страниц.
https://wiki.imacros.net/Data_Extractio … b_Scraping.

3 (изменено: Malcev, 2018-04-23 22:47:46)

Re: AHK: Вставка найденной информации в эксель

Я бы автоматизировал через WinHttpRequest.