titi9030 Posted June 6, 2016 Share Posted June 6, 2016 Good afternoon, I am usiting the following code to write something from Html to excel, the problem is that it just writes the code in range B1 and overwrite again , there are four string I need to write increasing in range A1, B1, C1, D1, not in jus B1 overwriting.. $aArray = _StringBetween($sHTML,'<DIV', '</DIV>') $sLast = "A" $iASCII = Asc($sLast) $iASCII += 1 $sNext = Chr($iASCII) for $a In $aArray ;ConsoleWrite($a & @CRLF) _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $a, $sNext & 1) sleep(1000) Next Thank you very much Link to comment Share on other sites More sharing options...
water Posted June 7, 2016 Share Posted June 7, 2016 Put your data into a 2D array with 1 row and 4 columns and then use _Exce_RangeWrite to write the array to A1. 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...
titi9030 Posted June 8, 2016 Author Share Posted June 8, 2016 Good evening, I tried to figure out how to use it from the helpfile, but unfortunatelly, it continue increasing the row B1.B2.B3,B4, instead of column b1,c1,d1,e1 Could you please advise and let me know what is wrong? please see attahced how it looks thank you very much Local $aArray[4][4] $aArray = _StringBetween($sHTML,'<DIV', '</DIV>') For $i = 0 To 4 For $j = 0 To 4 Next Next for $a In $aArray ;ConsoleWrite($a & @CRLF) _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $aArray, "b1") sleep(1000) Next Link to comment Share on other sites More sharing options...
water Posted June 8, 2016 Share Posted June 8, 2016 When posting code could you please remove the empty lines and use code tags (the "<>" button in the editor)? Makes reading your code much easier 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...
water Posted June 8, 2016 Share Posted June 8, 2016 Example how it schould work: #include <Excel.au3> Global $aArray[] = [1, 2, 3] ; 1D Array with 3 rows _ArrayDisplay($aArray, "1D - 3 rows") _ArrayTranspose($aArray) ; 2D array with 1 row, 3 columns _ArrayDisplay($aArray, "2D - 1 row, 3 columns") Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookNew($oExcel) Global $oRange = _Excel_RangeWrite($oWorkbook, Default, $aArray, "A1") 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