Small Posted February 26, 2016 Share Posted February 26, 2016 Hi I'm Daan but ppl call me Small, I made a little script for my work to export data from IE to an array and pasting that into excel. expandcollapse popup#include <IE.au3> #include <Excel.au3> #include <File.au3> #include <Msgboxconstants.au3> #include <array.au3> #include <StringConstants.au3> ;Ga naar rgd-inspecties.nl/pages/home.aspx ;zoek het ; Global $url = InputBox("URL", "Wat is de Link van de website?","","",200,150) Global $condor = "ctl00_contentPage_gridInspectie_ctl00__" Global $ID Global $Colom Global $e Global $path = @DesktopDir & "/smartware/Standaard.xls" Export() Func Export() Local $oIE = _IEAttach($url, "url") Local $oTable = _IETableGetCollection($oIE,48) Local $aTableData = _IETableWriteToArray($oTable) Local $count = ubound($aTableData,2) -3 ConsoleWrite("Er zijn "&$count&" Elementen.") #Region Loop For $ID = 0 to $count Local $atable = _IEGetObjById($oIE,$condor&$ID) For $Colom = 2 to 11 step 1 $td = _IETagNameGetCollection($atable,"td",$Colom) $removeWS = StringReplace($td.innerhtml,"<br>",";") $removebr = StringStripWS($removews,8) $removeall = StringReplace($removebr," ",";") Local $splittest4 = StringSplit($removeall,";",1) ;~ _ArrayDisplay($splittest4) Local $r = UBound($splittest4)-1 For $e = 1 to $r FileWrite($path,$splittest4[$e]&@CRLF) ;~ MsgBox(64,"",$splittest4[$e]) Next Next Next #EndRegion loop EndFunc I got it working so that is writes the data to seperate cells in excel. The problem is that it is vertical and it needs to be horizontal. Is there an easy way of doing this? I saw on some other topics that they used _ExcelWriteCell but that isn't in the Excel.au3 anymore. Thanks in advance for the help. Regards, Small Link to comment Share on other sites More sharing options...
Small Posted February 26, 2016 Author Share Posted February 26, 2016 P.S. I'm sorry for my bad english. I'm dutch so there are some dutch words/sentences in there. Link to comment Share on other sites More sharing options...
water Posted February 26, 2016 Share Posted February 26, 2016 (edited) _ExcelWriteCell has been renamed to _Excel_RangeWrite in the latest version ogf AutoIt. What has changed can be found here and in the wiki. Edited February 26, 2016 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...
Small Posted February 26, 2016 Author Share Posted February 26, 2016 @water I found my solution. I used _excel_rangewrite like you said and it works perfect. thank you so much Link to comment Share on other sites More sharing options...
water Posted February 26, 2016 Share Posted February 26, 2016 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