Brianlivingston1991

Auto Log In several sites from Excel

9 posts in this topic

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 !

Share this post


Link to post
Share on other sites



This line is wrong

_IECreate("$url")

Try:

_IECreate($url)

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thanks for your help.

Unfortunately, it doesn't change anything :/

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

"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 :/

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 ?

Share this post


Link to post
Share on other sites

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)

 

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now