powaking 0 Posted August 26, 2011 Hello fellow Autoit scriptors. Its been a long time since I've needed to use AutoIt (job change). At the time we had a fully implemented support tool used across the country which assisted with remote support of our customers. But that ship has sailed (about 4 years ago) and much has changed. I'm recently in a new role and I see the need to utilize AutoIt but as you may have guessed it you either use it or lose it and I lost it. My request for assistance is I need to have a script read an Excel spreadsheet so that I can select 1 column from a dropdown box and have it display information pertaining to that row in other variables. I'm able to read the excel file into an array and then display the array but working within the array is where I'm stuck. There are about 170 rows and 17 columns of which I probably only need to work with 3-4 columns. Making the GUI is not the issue its just working out the array is where I need some assistance. Here is what I have so far. I also noticed that even after closing the sheet there's still an instance of Excel running, anyway to have that close out gracefully? Thanks!!! #include <GUIConstants.au3> #include <Excel.au3> #include <Array.au3> Local $oExcel = _ExcelBookOpen("c:\ExcelFile.xlsx",0,True) ;Local $oExcel=_ExcelBookOpen("c:\ExcelFile.xlsx") $aArray = _ExcelReadSheetToArray($oExcel,3,1,0,17) _ArrayDisplay ($aArray,"Sheet:",-1) _ExcelBookClose($oExcel) Exit Share this post Link to post Share on other sites
water 2,413 Posted August 26, 2011 Release the object and Excel should be gone after closing. #include <GUIConstants.au3> #include <Excel.au3> #include <Array.au3> Local $oExcel = _ExcelBookOpen("c:\ExcelFile.xlsx",0,True) ;Local $oExcel=_ExcelBookOpen("c:\ExcelFile.xlsx") $aArray = _ExcelReadSheetToArray($oExcel,3,1,0,17) _ArrayDisplay ($aArray,"Sheet:",-1) _ExcelBookClose($oExcel) $oExcel = 0 ; <== Exit My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2021-04-14 - Version 1.5.3.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2021-04-13 - Version 1.6.4.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (NEW 2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
powaking 0 Posted August 26, 2011 Release the object and Excel should be gone after closing. #include <GUIConstants.au3> #include <Excel.au3> #include <Array.au3> Local $oExcel = _ExcelBookOpen("c:\ExcelFile.xlsx",0,True) ;Local $oExcel=_ExcelBookOpen("c:\ExcelFile.xlsx") $aArray = _ExcelReadSheetToArray($oExcel,3,1,0,17) _ArrayDisplay ($aArray,"Sheet:",-1) _ExcelBookClose($oExcel) $oExcel = 0 ; <== Exit Unfortunately that didn't work. I'll try to figure out how to kill the excel process but still would like some help with working with the Array and again only certain columns. TIA Share this post Link to post Share on other sites