attractiveguy Posted April 26, 2017 Share Posted April 26, 2017 Hi, I searched a lot but couldn't find a solution, Please help me to sort out simple trick I'd like to write a script ,which pick user name and password ,fill into a website and then wait for a function to complete and move to next row, I have tried many way but couldn't get through, If someone can please share the code, Shall be thankful, Link to comment Share on other sites More sharing options...
attractiveguy Posted April 26, 2017 Author Share Posted April 26, 2017 Hi, I searched a lot but couldn't find a solution, Please help me to sort out simple trick I'd like to write a script ,which pick user name and password ,fill into a website and then wait for a function to complete and move to next row, I have tried many way but couldn't get through, If someone can please share the code, Shall be thankful, Link to comment Share on other sites More sharing options...
water Posted April 26, 2017 Share Posted April 26, 2017 AutoIt comes with an Excel UDF, each function comes with an example script. _Excel_RangeRead should be a good starting point. 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...
Moderators JLogan3o13 Posted April 26, 2017 Moderators Share Posted April 26, 2017 Merged posts "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
attractiveguy Posted April 26, 2017 Author Share Posted April 26, 2017 @water, thanks a lot for a prompt reply. yes, that's the one , I am using, I am running the following code, it stops after reading all the cell, I'd like it read first cell and then enter these details to website,and then move to next cell. @water I am glad to see you here, I can see you are helping since 2008. I have already searched a lot,but couldn't the solution.please help.thanks a lot in advance <autoit> #include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> ; Create application object Local $oExcel = _Excel_Open() Local $bReadOnly = False Local $bVisible = True Local $var = 1 Local $R = "D" & $var & ":" & "E" & $var ; **************************************************************************** ; Open an existing workbook and return its object identifier. ; ***************************************************************************** Local $sWorkbook = "D:\work\Variables\supplier\2016-2017\part01-31-07-2016.xlsx" Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook, $bReadOnly, $bVisible) Local $aResult = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.Usedrange.Columns("D"), 1) ConsoleWrite($aResult & @CRLF) for $username In $aResult ConsoleWrite($username & @CRLF) Next </autoit> Link to comment Share on other sites More sharing options...
attractiveguy Posted April 26, 2017 Author Share Posted April 26, 2017 @JLogan3o13, not sure,how I posted second time,thanks for merging, Link to comment Share on other sites More sharing options...
Subz Posted April 26, 2017 Share Posted April 26, 2017 Try: #include <Array.au3> #include <Excel.au3> ; Create application object Local $oExcel = _Excel_Open() Local $bReadOnly = False Local $bVisible = True Local $var = 1 Local $R = "D" & $var & ":" & "E" & $var ; **************************************************************************** ; Open an existing workbook and return its object identifier. ; ***************************************************************************** Local $sWorkbook = "D:\work\Variables\supplier\2016-2017\part01-31-07-2016.xlsx" Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook, $bReadOnly, $bVisible) Local $aResult = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.Usedrange.Columns("D"), 1) _ArrayDisplay($aResult) For $i = 1 To UBound($aResult) - 1 ConsoleWrite($aResult[$i] & @CRLF) Next Link to comment Share on other sites More sharing options...
water Posted April 26, 2017 Share Posted April 26, 2017 (edited) If the Excel worbook isn't too large I would read the whole sheet and then process th returned array: #include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> ; Create application object Local $oExcel = _Excel_Open() Local $bReadOnly = False Local $bVisible = True Local $var = 1 Local $R = "D" & $var & ":" & "E" & $var ; **************************************************************************** ; Open an existing workbook and return its object identifier. ; ***************************************************************************** Local $sWorkbook = "D:\work\Variables\supplier\2016-2017\part01-31-07-2016.xlsx" Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook, $bReadOnly, $bVisible) Local $aResult = _Excel_RangeRead($oWorkbook) For $i = 0 To UBound($aResult, 1) - 1 Consolewrite($aResult[$i][3] & @CRLF) ; Column D Next Edited April 26, 2017 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...
attractiveguy Posted April 26, 2017 Author Share Posted April 26, 2017 @Subz, Thanks a lot, community is really excellent,but unfortunately I wasn't mean that, sorry if I couldn't explain properly. after reading first row, it assign value to a variable and then put value into website, after first cell completion ,it should pick the second value, I am attaching php code to explain. which I can achieve through php. $R will print before adding 1 to $var1. $var1 = 1; while ($var1<=10){ $R = "D"; $C = "E$"; echo "$R<br>"; $var1++; } Link to comment Share on other sites More sharing options...
attractiveguy Posted April 26, 2017 Author Share Posted April 26, 2017 @water, Unfortunately code is not stopping to assign value to a variable. it just keep reading until end. Link to comment Share on other sites More sharing options...
water Posted April 26, 2017 Share Posted April 26, 2017 Some questions regarding your PHP code: Why do you increment $var1 in a loop and then not use it in the loop? The same is true for $C. It gets a string assigned but is not referenced in the loop. 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...
attractiveguy Posted April 26, 2017 Author Share Posted April 26, 2017 Please forget the $C, I am assign $var1 to $R. $R is equal to"D(coloumn)$var1"; so by changing $var1 value, I am going to next row each time. Link to comment Share on other sites More sharing options...
attractiveguy Posted April 26, 2017 Author Share Posted April 26, 2017 Okay, I think ,I have figured it out. But the support from the community is excellent. I really appreciate all you guys for help me this, I spent two days to figure it out. Special thanks to @water and @Subz Link to comment Share on other sites More sharing options...
water Posted April 26, 2017 Share Posted April 26, 2017 attractiveguy 1 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