Hi,
I have this piece code that works with Excel file and finds the column name where is a specific named range located.
Local $Column = Null
$Column = _Excel_ColumnToLetter($oWorkbook.Sheets("MySheetName").Range("MyRangeName").Column)
If @error Then
$Column = Null
SetError(0)
Else
;Proceed...
EndIf
It works properly if the named range exists in the Excel file, I do get the column name and the "Proceed" part is correctly executed. If the named range is not present in the Excel file, I would expect the If @error part to set the variable to Null and then follow with the rest of the function after EndIf. Instead, the script stops and I get this error:
"C:\test\script_021.au3" (1184) : ==> The requested action with this object has failed.:
$Column = _Excel_ColumnToLetter($oWorkbook.Sheets("MySheetName").Range("MyRangeName").Column)
$Column = _Excel_ColumnToLetter($oWorkbook.Sheets("MySheetName")^ ERROR
What am I doing wrong here? Is it possible that failure to set the variable doesn't set the @error? Push in the right direction would be much appreciated. Thanks!