Jump to content

_Excel_RangeFind fails


aiter
 Share

Recommended Posts

I have tried to use _Excel_RangFind, but it fails. It even fails in the example in the help file (see example 1).

This the error

>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\Program Files (x86)\AutoIt3\Examples\Helpfile\_Excel_RangeFind.au3
+>12:09:10 AU3Check ended.rc:0
>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Program Files (x86)\AutoIt3\Examples\Helpfile\_Excel_RangeFind.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
"C:\Program Files (x86)\AutoIt3\Include\Excel.au3" (656) : ==> The requested action with this object has failed.:
$aResult[$iIndex][1] = $oMatch.Name.Name
$aResult[$iIndex][1] = $oMatch^ ERROR

My own code fails with a similar message

Local $aResult = _Excel_RangeFind($oWorkbook, "john")
_ArrayDisplay($aResult)

Help please.

 

Link to comment
Share on other sites

Oh, just saw message at the top of the board.  is it best to create my own find function in my program using the fixed code?

Will it be fixed in the new autoit release or is there a new release already (I am using 3.3.14.2)?

Edited by aiter
Link to comment
Share on other sites

It's a bug in Autoit 3.3.14.2 but there is no release date for a new AutoIt version.
For the time being _Excel_RangeFinder is a cool solution ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

There is a still a problem with this function. When it does not find the value, it still returns an array and does not set @error.    

Local $aResult = _Excel_RangeFinder($oWorkbook, "garbageeeee") ;,$SheetRange)
;if @error <> 0 Then
    MsgBox(0,'',@error & ' -- ' & $aResult)
;endif
_ArrayDisplay($aResult)

displays 0 for @error , $aResult is an empty array

How do I know when no match is found?

What is Default?  Displaying it shows a literal value of 'Default'. It seems to be understood by the API.  It confuses me.

Edited by aiter
Link to comment
Share on other sites

"No records found" isn't returned as an error by Excel. The function just returns an empty array. So you need to check for the number of rows in the array.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
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
 Share

×
×
  • Create New...