emanemos Posted August 1, 2014 Share 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 Link to comment Share on other sites More sharing options...
water Posted August 1, 2014 Share 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 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...
emanemos Posted August 1, 2014 Author Share Posted August 1, 2014 help with the syntax !!!! Link to comment Share on other sites More sharing options...
water Posted August 1, 2014 Share 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 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...
emanemos Posted August 1, 2014 Author Share Posted August 1, 2014 (edited) yes but sheet3 is not active !!!! Edited August 1, 2014 by emanemos Link to comment Share on other sites More sharing options...
javiwhite Posted August 1, 2014 Share 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. Link to comment Share on other sites More sharing options...
water Posted August 1, 2014 Share 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 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...
emanemos Posted August 1, 2014 Author Share Posted August 1, 2014 Thanks; You save my life Link to comment Share on other sites More sharing options...
water Posted August 1, 2014 Share 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 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