Jump to content
Sign in to follow this  
emanemos

not activesheet

Recommended Posts

emanemos

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 by emanemos

Share this post


Link to post
Share on other sites
water

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 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
emanemos
  • help with the syntax !!!!

Share this post


Link to post
Share on other sites
water

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 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
emanemos

yes but sheet3 is not active !!!!

Edited by emanemos

Share this post


Link to post
Share on other sites
javiwhite

$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 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.

Share this post


Link to post
Share on other sites
water

For _Excel_RangeRead to work the specified sheet does not need to be active !!!!


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
emanemos

Thanks; You save my life :bye:

Share this post


Link to post
Share on other sites
water

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 by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×