Menna Posted June 5, 2020 Share Posted June 5, 2020 I need to create a script read values from excel sheet cell by cell then added in calculator Link to comment Share on other sites More sharing options...
water Posted June 5, 2020 Share Posted June 5, 2020 Welcome to AutoIt and the forum! What have you tried so far? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Menna Posted June 6, 2020 Author Share Posted June 6, 2020 i tried to copy list of values from excel sheet cell by cell and past it in another excelsheet Link to comment Share on other sites More sharing options...
water Posted June 6, 2020 Share Posted June 6, 2020 (edited) You did notice that AutoIt comes with an Excel UDF (library of User Defined Functions)? Edited June 6, 2020 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Menna Posted June 6, 2020 Author Share Posted June 6, 2020 no i need a a simple from the code do copy from excel sheet cell by cell then past it in notebad Link to comment Share on other sites More sharing options...
water Posted June 6, 2020 Share Posted June 6, 2020 That's exactly what you can do with this UDF. Functions _Excel_RangeRead or _Excel_RangeCopyPaste should do what you want to do. Have a look at the help file. There are a lot of examples too. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Menna Posted June 6, 2020 Author Share Posted June 6, 2020 i have create and find this example and still find an issue as the script looping #include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> ;Essentially i am trying to copy an excel cell, paste it somewhere go back to excel, go down a cell and repeat untill the cell is blank Local $oExcel = _Excel_Open() Local $sWorkbook = @ScriptDir & "\Book1.xls" Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook) ;Unsure if instead of using a cell range i should be getting excel to read one cell, then in the next loop add a 1 to the cell and read again. Eg. Read A1 do function, read A2 do function Local $aResult = _Excel_RangeRead($oWorkbook,1, "A1:A14") Do WinActivate("Microsoft Excel - Book1.xls") Send("{CTRLDOWN}c{CTRLUP}") ;Copy cell WinActivate("Untitled - Notepad") Send("{CTRLDOWN}v{CTRLUP}") ;Paste cell WinActivate("Microsoft Excel - Book1.xls") ;Go down a cell Send("{ENTER}{ENTER}") Until $aResult = "" Exit Link to comment Share on other sites More sharing options...
water Posted June 6, 2020 Share Posted June 6, 2020 (edited) I suggest: #include <Excel.au3> Local $oExcel = _Excel_Open() Local $sWorkbook = @ScriptDir & "\Book1.xls" Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook) Local $aResult = _Excel_RangeRead($oWorkbook, 1, "A1:A14") WinActivate("Untitled - Notepad") For $i = 0 to UBound($aResult, 1) - 1 Send($aResult[$i] & @CRLF) Next Exit Edited June 7, 2020 by water Added @CRLF so each value goes to a separate line My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Menna Posted June 7, 2020 Author Share Posted June 7, 2020 (edited) Thanks so much for your support but when when I'm tried i found that the result displayed all values in the same line and also i need to copy first item then make a manipulation once done will go to copy another one and so on Edited June 7, 2020 by Menna Link to comment Share on other sites More sharing options...
water Posted June 7, 2020 Share Posted June 7, 2020 I added a @CRLF to my script above so each value gooes to a seprate line. What do you mean with "manipulation"? In the AutoIt script? In Notepad? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Menna Posted June 7, 2020 Author Share Posted June 7, 2020 i will add @CRLF i need to copy one value in cell then i will add to the application text box then i will click button in the application as submittion , and check the data displayed successfully in the application Then back to the sheet and copy the another cell so back to the app and submit the another one and so on Link to comment Share on other sites More sharing options...
water Posted June 7, 2020 Share Posted June 7, 2020 Then I suggest to use the following commands: ControlSend to send the data to your application, ControlClick to click the button and WinWait to wait until processing has ended. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Menna Posted June 7, 2020 Author Share Posted June 7, 2020 iam using a mouse click for controlclick , there is any solution becouse the application has no id for class name or instance ? Link to comment Share on other sites More sharing options...
water Posted June 7, 2020 Share Posted June 7, 2020 It's hard to tell without knowing which application we are talking about. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
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