Queener Posted March 18, 2016 Posted March 18, 2016 (edited) Local $aArray1D[1][5] = [["Index","AssetTag","Description","Location","Date"]] ;write Columns Titles on A1 thru E1 _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $aArray1D, "A1") ;loop through sections along with its values $i = IniReadSectionNames($fileloc) $a = 0 Local $getindex = IniRead($fileloc, $i[1], "index", "default") Local $getasset = IniRead($fileloc, $i[1], "Asset", "default") Local $getdes = IniRead($fileloc, $i[1], "Des", "default") Local $getloc = IniRead($fileloc, $i[1], "Loc", "default") Local $getdate = IniRead($fileloc, $i[1], "Date", "default") Local $aArray2D[1][5]=[[$getindex,$getasset,$getdes,$getloc,$getdate]] For $i[1] = 1 to UBound($i)-1 $a += 1 _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, , "A"&$a+1) $i += 1 Next I have a total of 4 record and it loop correctly, but when it writes on excel, the first record gets repeated on excel... I tried multiple ways, but stuck on how to get it work correctly... EDIT: Nvm, I just put the variables inside the loop and it works... Edited March 18, 2016 by Queener Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")
JohnOne Posted March 18, 2016 Posted March 18, 2016 looks odd. try commenting the following line out. $i += 1 $i is an array. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
water Posted March 18, 2016 Posted March 18, 2016 There is no need to write data in a loop to Excel - actually it is just slow. Pass a variable, a 1D or 2D array to _Excel_RangeWrite. 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
Queener Posted March 18, 2016 Author Posted March 18, 2016 I stumble across a topic about ini to excel and thought I give it a shot for project. I've done a write direct to excel and it's much faster, but with this project; I just wanted to test out varieties way of exporting from ini to other format. Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")
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