emanemos Posted August 1, 2014 Posted August 1, 2014 (edited) Hi, before I was using the command $RowCount = $oWorkbook.ActiveSheet.UsedRange.Rows.Count Now I want to do this command on a particular sheet but not active with _Excel_RangeRead($oWorkbook,"sheet3", "B" &$j) Do you know the syntax? with the new version AutoIt thanks for your help Edited August 1, 2014 by emanemos
water Posted August 1, 2014 Posted August 1, 2014 according to the help file Parameter 2 allows to specify the sheet by name, index or as an worksheet object. $vWorksheet [optional] Name, index or worksheet object to be read. If set to keyword Default the active sheet will be used (default = keyword Default) So "sheet3" should work if this is the name of the worksheet. 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
water Posted August 1, 2014 Posted August 1, 2014 But your syntax is correct. Is "sheet3" the name of the sheet you want to read? 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
emanemos Posted August 1, 2014 Author Posted August 1, 2014 (edited) yes but sheet3 is not active !!!! Edited August 1, 2014 by emanemos
javiwhite Posted August 1, 2014 Posted August 1, 2014 (edited) $oWorkbook.Sheets(3).select will make sheet 3 the activesheet. EDIT: apologies, I see you want to avoid making this the activesheet. In that case: $oWorkbook.Sheets(3).UsedRange.Rows.Count Edited August 1, 2014 by javiwhite give a man an application, and he'll be frustrated for the day, Teach him how to program applications and he'll be frustrated for a lifetime.
water Posted August 1, 2014 Posted August 1, 2014 For _Excel_RangeRead to work the specified sheet does not need to be active !!!! 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
water Posted August 1, 2014 Posted August 1, 2014 (edited) What is the value of @error after _Excel_RangeRead? $sResult = _Excel_RangeRead($oWorkbook,"sheet3", "B" &$j) MsgBox(0, "Result", "@error = " & @error & @CRLF & "Result: " & $sResult) Edit: Seems like the problem is solved! Edited August 1, 2014 by water 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
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