Copying from excel In chrome and back

Post your working scripts, libraries and tools for AHK v1.1 and older
inseption86
Posts: 205
Joined: 19 Apr 2018, 00:24

Copying from excel In chrome and back

19 Apr 2018, 00:30

Forgive me for my English, Hello, tell me whether it is possible to automate routine work, for example, there is xls, in column A with some rows of data, you need to copy one cell into chrome into a certain coordinate and copy the result back to xls in column B and also to all other cells

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 Chrome_WidgetWin_1
Sleep 550
	
	
Click, 242, 318, 2
Sleep 150
Send %B_stored%
send {enter}
Sleep 2000
Click, 225, 432, 2
send {vk43}
	
	
; 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 

F12::                 
Pause
return



$Esc::ExitApp ;EMERGENCY EXIT HOTKEY
To make the cell copy in chrome made, selected the found old, and how to copy it back into the Excel and so on to the end of the specified lines

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 134 guests