Jump to content
Sign in to follow this  
SiSa90

Rangeread from excel to a website

Recommended Posts

Hi i am new to autoit (2 months by now) and i hope i am in the right topic of this forum. i managed to make an automatation on my pc inserting keywords on a website. (eg. Dog, cat, animal, fur, etc.) all of them seperated with a comma. On my old pc everything worked fine, on the new one, on this special field of the website, it completly ignores all the commas. (eg. Dogcatanimalfur....) i dont know if this is an autoit error of the autoit version i downloaded, or if it has to do with the browser (chrome) or the excel file (windows10). I would be happy if someone finds time to help me. 

Kind regards

Simon

Share this post


Link to post
Share on other sites

Welcome to AutoIt and the forum!

You need to provide more information which allows us to help you. At least:

  • The version of AutoIt you run
  • The script code you run

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-09-05 - Version 1.5.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

Hi, thanks for the reply, sure, this is the code i used:
 

;Open Excel

#include <Excel.au3>
Local $oExcel_1 = _Excel_Open()
Local $var = "D:\99zz_Keywords&Descriptions.xlsx"
Local $oWorkbook = _Excel_BookOpen($oExcel_1,$var)

;Read Excel
Local $_read1 = _Excel_RangeRead($oWorkbook, Default , "A2")
Local $_read2 = _Excel_RangeRead($oWorkbook, Default , "B2")
Local $_read3 = _Excel_RangeRead($oWorkbook, Default , "A3")
Local $_read4 = _Excel_RangeRead($oWorkbook, Default , "B3")
Local $_read5 = _Excel_RangeRead($oWorkbook, Default , "A4")
Local $_read6 = _Excel_RangeRead($oWorkbook, Default , "B4")
Local $_read7 = _Excel_RangeRead($oWorkbook, Default , "A5")
Local $_read8 = _Excel_RangeRead($oWorkbook, Default , "B5")
Local $_read9 = _Excel_RangeRead($oWorkbook, Default , "A6")
Local $_read10 = _Excel_RangeRead($oWorkbook, Default , "B6")
Local $_read11 = _Excel_RangeRead($oWorkbook, Default , "A7")
Local $_read12 = _Excel_RangeRead($oWorkbook, Default , "B7")
Local $_read13 = _Excel_RangeRead($oWorkbook, Default , "A8")
Local $_read14 = _Excel_RangeRead($oWorkbook, Default , "B8")
Local $_read15 = _Excel_RangeRead($oWorkbook, Default , "A9")
Local $_read16 = _Excel_RangeRead($oWorkbook, Default , "B9")
Local $_read17 = _Excel_RangeRead($oWorkbook, Default , "A10")
Local $_read18 = _Excel_RangeRead($oWorkbook, Default , "B10")
Local $_read19 = _Excel_RangeRead($oWorkbook, Default , "A11")
Local $_read20 = _Excel_RangeRead($oWorkbook, Default , "B11")
Local $_read21 = _Excel_RangeRead($oWorkbook, Default , "B12")

WinActivate("Spreadshirt - Google Chrome")
Sleep(1000)

; Manage All Prices and Tags (Screen 80%)
MouseClick ("left" , 424 , 94 , 1 ) ; Click Filter Designs
Sleep (1000)
MouseClick ("left" , 241 , 159 , 1 ) ; Click Filter new Designs
Sleep (1500)
MouseClick ("left" , 127 , 95 , 1 ) ; Click Choose All
Sleep (1500)
MouseClick ("left" , 355 , 95 , 1 ) ; Click Designprice
Sleep (1500)
MouseClick ("left" , 1079 , 153 , 1 ) ; Click Enter Price
Sleep (1000)
MouseClick ("left" , 1079 , 153 , 1 ) ; Click Enter Price 2
Sleep (500)
Send ("9.0") ; Price CHF / Dollar / Euro
Sleep (1000)
MouseClick ("left" , 805 , 702 , 1 ) ; Click Button Done
Sleep (3000)

;***********************************************************************

;Design Number 1
MouseClick ("left" , 53 , 232 , 1 ) ; Click Button Designs
Sleep (1500)
MouseClick ("left" , 424 , 94 , 1 ) ; Click Filter Designs
Sleep (1000)
MouseClick ("left" , 241 , 159 , 1 ) ; Click Filter new Designs
Sleep (1500)
MouseClick ("left" , 315 , 287 , 1 ) ; Click Designauswahl Nr. 1
Sleep (1500)
MouseClick ("left" , 1192 , 301 , 1 ) ; Click Sample Laden
Sleep (1500)
MouseClick ("left" , 868 , 407 , 1 ) ; Click Load
Sleep (1500)
MouseClick ("left" , 888 , 701 , 1 ) ; Click Button Next
Sleep (1500)
MouseClick ("left" , 785 , 271 , 3 ) ; Click into the title
Sleep (1500)
send("{backspace}")
Sleep (1000)
send($_read1)   ;Title--------------------------------------------------
Sleep (1000)
send("{tab}") ;Move into the Description
Sleep (1000)
send($_read2)  ;Description--------------------------------------------
sleep (1000)
MouseClick ("left" , 758 , 521 , 1 ) ; Click into tags
sleep (1000)
send("{backspace}")
sleep (100)
send("{backspace}")
sleep (100)
send("{backspace}")
sleep (100)
send("{backspace}")
sleep (100)
send("{backspace}")
sleep (100)
send("{backspace}")
sleep (100)
send("{backspace}")
sleep (1000)
send($_read21)  ; enter Tags--------------------------------------------
Sleep (1500)
MouseClick ("left" , 803 , 702 , 1 ) ; Click Button Next
sleep (1000)
MouseClick ("left" , 803 , 702 , 1 ) ; Click Button Next
Sleep (1500)
MouseClick ("left" , 811 , 700 , 1 ) ; Click Button create
Sleep (1500)
MouseClick ("left" , 811 , 700 , 1 ) ; Click Button create
Sleep (1500)
MouseClick ("left" , 51 , 237 , 2 ) ; Click Button Designs
Sleep (1500)
MouseClick ("left" , 51 , 237 , 2 ) ; Click Button Designs
Sleep (1500)

 

I have marked the one troubeling me in red. I would be happy for your help.

Simon

Share this post


Link to post
Share on other sites

I just tryed to insert the rangeread writing into a word document, it all worked fine, so i think the isue is on the website. I thought maybe it would be possible to Copy and paste this single cell into the box on the website, since with copy and paste it works fine. Is there a command i can copy from the excel sheet without tab into it, using rangeread?

Share this post


Link to post
Share on other sites

Try and use the IE functions to add data to your site, it's more reliable than MouseClick and Copy and Paste.  If you want to cuse Copy and Paste you could use _Excel_RangeCopyPaste function.

Share this post


Link to post
Share on other sites

@SiSa90

Welcome to the AutoIt forum! :)

As @Subz suggested, use _IE* functions to insert the data you read from the Excel file.

And, I'd suggest you to use a single _Excel_RangeRead(), specifying your range as "A2:B12", so you'll have only one function call, and you can see if the cells in the interval have been read correctly using _ArrayDisplay function.

Something like this:

$arrRangeRead = _Excel_RangeRead($objWorkbook, Default, "A2:B12") ; In this case, $arrRangeRead is a 2-Dimension array in which are stored the values from the cell A2 to B12.
; You can see the content and the "structure" of the array using _ArrayDisplay($arrRangeRead).

I noticed that you are skipping the cell A12, so you "have to" skip it either when you paste your data in the webpage.

Try these things and let us know :)

Edited by FrancescoDiMuro

Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...