Brianlivingston1991 Posted April 29, 2016 Share Posted April 29, 2016 I'm trying to make an auto log in program. Concretely, I'd like to log me to social networks, mail box, etc. from an excel file with the following data: - column A : the url fo these sites - column B : my ID for each - column C : password I'd like my bot to read the information in column A, launch Internet Explorer (with an _IECreate) and then fil the form "ID" and "password" (by reading the information in column B and C). I'm ok with the "filling" part (there is a lot of tutorials on Youtube), but I have a problem when it comes to "read" the data in my excel file to reach the URL I've written the following code : #include <Excel.au3> #include <IE.au3> $oExcel = _Excel_Open() $oFile = "C:\Desktop\Reminders.xlsx" _Excel_BookOpen($oExcel, $oFile) sleep(1000) $url = _Excel_RangeRead($oExcel, 2, 1) _IECreate("$url") The problem is that my code is unable to actually read what is in the cell because when it launches IE, I land on http://$url/ file ... :/ Is _Excel_RangeRead the right function to do what I want ? I'm using autoit V3.3.14.1 (I don't have _excel_readcell in it). Thank you for your help ! Link to comment Share on other sites More sharing options...
water Posted April 29, 2016 Share Posted April 29, 2016 This line is wrong _IECreate("$url") Try: _IECreate($url) My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Brianlivingston1991 Posted April 29, 2016 Author Share Posted April 29, 2016 Thanks for your help. Unfortunately, it doesn't change anything :/ Link to comment Share on other sites More sharing options...
MichaelHB Posted April 29, 2016 Share Posted April 29, 2016 Check: $url = _Excel_RangeRead($oExcel, 2, 1) - "Excel workbook object" See the first example in the helpfile. And also check the other parameters to see if you are missing something else. Link to comment Share on other sites More sharing options...
Brianlivingston1991 Posted April 29, 2016 Author Share Posted April 29, 2016 "Unknown function name.: $url = _Excel_RangeRead($oFile, Default, A1) $url = _Excel_RangeRead($oFile, Default, ^ ERROR" By using the same structure as the first example in the helpfile :/ Link to comment Share on other sites More sharing options...
alien4u Posted April 29, 2016 Share Posted April 29, 2016 I think it should be something like this: $oExcel = _Excel_Open() ;opens a new instance of the Excel software $Workbook = _Excel_BookOpen($oExcel, "C:\Desktop\Reminders.xlsx") $url = _Excel_RangeRead($Workbook, $Workbook.Activesheet, "A1", 1) _IECreate($url) Regards Alien Link to comment Share on other sites More sharing options...
water Posted April 29, 2016 Share Posted April 29, 2016 The cell reference needs to be a string: $url = _Excel_RangeRead($oFile, Default, "A1") Default means: $Workbook.Activesheet My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Brianlivingston1991 Posted April 29, 2016 Author Share Posted April 29, 2016 You're right, your solution works perfectly !! Thanks a lot @alien4u ! Now just one more thing : instead of writing A1 to log on the first site, and then A2 for the second, etc. until the site number N (N rows in my excel), I'd like to do a loop. Do you know how to do it ? The idea would be the following loop : $geturl = _Excel_RangeRead($oFile, $oFile.Activesheet, "A+$i") $oIE = _IECreate($geturl) Do you know how could I do it ? Link to comment Share on other sites More sharing options...
water Posted April 29, 2016 Share Posted April 29, 2016 I think you should start to read the AutoIt help file to understand the basics of the language. You put everything into a string - even the variable. Should be: $geturl = _Excel_RangeRead($oFile, $oFile.Activesheet, "A" & $i) Jfish 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - 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