Kait0 Posted February 8, 2024 Posted February 8, 2024 Hello everyone! I need some direction how schould i approach my problem. I have a spreadsheet lets say A and B with around 60 positions now depends whats number is in A and B the script schould do some input for example press arrow two times down then press enter and move to next position. Any ideas ? i loaded the spreadsheet into an array and then i got lost
Nine Posted February 8, 2024 Posted February 8, 2024 Show the code you have along with an example of the spreadsheet. Maybe then it be clearer what you are aiming at, cause right now, it is clear as mud “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Multi-Threading Made Easy
Kait0 Posted February 8, 2024 Author Posted February 8, 2024 #include <Array.au3> #include <Excel.au3> Global $iTotalTime = 0 Test() Func Test() Local $oExcel = _Excel_Open() Local $oBook = _Excel_BookAttach("Test.xlsx", "FileName", $oExcel) Local $sSheet = "Sheet1" If @error Then Return MsgBox($MB_ICONERROR, "Excel Failed", "Failed to attach to Excel") Local $iNum Local $aData = _Excel_RangeRead($oBook, $sSheet, "A1:B164", 1, True) _ArrayDisplay($aData) EndFunc Like i said i just loaded the excel spreadsheet into array thats it. So In the spreadsheet a1 is 10 b1 is 104. so the script should switch focus to other program (i know how to do that) then press enter press 1 then 0 enter then 104 enter then move to A2:B2 and do the same till the end of the spreadsheet. i assume a loop is not a good idea if there is a lot of entrys. Im also a begginer in autoit but want to learn it. Big Thanks for help. Test.xlsx
Solution Andreik Posted February 8, 2024 Solution Posted February 8, 2024 Something like this? #include <Excel.au3> Test() Func Test() Local $oExcel = _Excel_Open(False) Local $oBook = _Excel_BookOpen($oExcel, @ScriptDir & '\Test.xlsx', True, False) Local $aData = _Excel_RangeRead($oBook, Default, 'A1:B164', 1, True) _Excel_Close($oExcel) Local $aSplit For $Index = 0 To UBound($aData) - 1 If Not $aData[$Index][0] Then ContinueLoop ; Focus here your desired window Send('{ENTER}' & $aData[$Index][0] & $aData[$Index][1] & '{ENTER}') ; As an alternative you migth want to use ControlSend() Next EndFunc etidd 1
Kait0 Posted February 9, 2024 Author Posted February 9, 2024 Andreik it works like a charm! Looks like Goku is not only master martial artist also master programmer Big thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now