claycrosby123 Posted April 8, 2015 Share Posted April 8, 2015 Hi all, I am working on a data entry utility to enter large amounts of data into a piece of software. My data lives in a series of excel spreadsheets each with 6 columns and 100 rows (the software into which I'm entering my data has a limit of 100 rows per entry). I'm having a hard time getting my arrays to populate with data from Excel. Here's what I've got set up: ;; Populate arrays with CDM charge info from excel doc Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel,@DesktopDir & "\AutoItTest.xlsx") Sleep(2000) Local $aProcedure = _Excel_RangeRead($oExcel,Default,$oWorkbook.ActiveSheet.Usedrange.Columns("A:A"),1) I then repeat this for each of my other 5 columns of data. Based on the information in Help, I take this to populate my $aProcedure array with all of the contents in column A. Please help! Thank you! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 8, 2015 Moderators Share Posted April 8, 2015 (edited) This works just fine for me: #include <Array.au3> #include <Excel.au3> Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel, @DesktopDir & "\Test.xls") Local $aArray = _Excel_RangeRead($oWorkbook, Default, "A:A") _ArrayDisplay($aArray) Edit: Sorry, I missed that you're trying to get used range only... Modified, this works for me: #include <Array.au3> #include <Excel.au3> Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel, @DesktopDir & "\Test.xls") Local $aArray = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.UsedRange.Columns("A:A")) _ArrayDisplay($aArray) Edited April 8, 2015 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
water Posted April 8, 2015 Share Posted April 8, 2015 Parameter 1 for function_Excel_RangeRead should be the workbook object, not the Excel application object. Means: Replace $oExcel with $oWorkbook 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...
Moderators JLogan3o13 Posted April 8, 2015 Moderators Share Posted April 8, 2015 Missed that completely "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
claycrosby123 Posted April 8, 2015 Author Share Posted April 8, 2015 Thank you very much! Simple fix Link to comment Share on other sites More sharing options...
water Posted April 8, 2015 Share Posted April 8, 2015 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