Sign in to follow this  
Followers 0
setirich

Help with _ExcelSheetUsedRangeGet related error

2 posts in this topic

I'm parsing out the returned array for this function, and continue to get the ==> Subscript used with non-Array variable.: error. I've checked up & down for problems...I seem to be opening & naming & referencing properly, but perhaps I'm spending too much time with this to see the error of my ways...

Here's the code I'm running:

_ExcelSheetActivate($Gsd_uBk, $Gsd_Unres_She)
$Gsd_Un_Range = _ExcelSheetUsedRangeGet($Gsd_uBk, $Gsd_Unres_She)
$Gsd_uLast_Row = $Gsd_Un_Range[3]oÝ÷ Ù8b±û§rب©©²æìz«ÚZ®È§­¶·­Úh®Ø¨íæ«­¬°¢¹,{azƦzÇ+Zn­óIbë!^¯­Øb±«­¢+Ù}á±M¡ÑÑ¥ÙÑ ÀÌØíÍ}   ¬°ÀÌØíÍ}
É}M¡¤(ÀÌØíÍ}
É}I¹ô}á±M¡ÑUÍI¹Ð ÀÌØíÍ}  ¬°ÀÌØíÍ}
É}M¡¤(ÀÌØíÍ}1ÍÑ}I½ÜôÀÌØíÍ}
É}I¹lÍoÝ÷ Ù8^~*ì¶Â­ø¥z)íë®*m«z+{(¡jÊ'zÈ^zاÔázÇ¢wpêÞ×hzÉ÷öÚò²¶È§Öî´ýè¥êåÊv¦xX­"ØbAÞ­íý²Ø^r^«x)zv¥{!yël#f®éçx"Øb²èqë,jëh×6; select the files & set referneces to the three books**********************
MsgBox ( 0, "Select the Tix file...", "First, you must find and open the Tix reporting file." )
$Att_Bk_k = MyFileOpenAtt("Select the Tix file...")
$Att_Bk = _ExcelBookOpen ( $Att_Bk_k )

MsgBox ( 0, "Select the GSD Create file...", "Next, you must find and open the file with the new CREATED GSD records." )
$Gsd_cBk_k = MyFileOpenAtt("Select the GSD Create file...")
_ExcelWriteCell($Att_Bk, $Gsd_cBk_k, 13, 2)
$Gsd_cBk = _ExcelBookOpen ( $Gsd_cBk_k )

MsgBox ( 0, "Select the GSD UnResolved file...", "Finally, you must find the file with the UNRESOLVED GSD records." )
$Gsd_uBk_k = MyFileOpenAtt("Select the GSD UnResolved file...")
_ExcelWriteCell($Att_Bk, $Gsd_uBk_k, 14, 2)
$Gsd_Bk = _ExcelBookOpen ( $Gsd_uBk_k )

I'm writing the workbook names into the att book where I'm doing all the "work".

If you have any idea what I'm doing wrong, I'd sure appreciate some clues....

Thanks,


Good intentions will always be pleaded for every assumption of authority. It is hardly too strong to say that the Constitution was made to guard the people against the dangers of good intentions. There are men in all ages who mean to govern well, but they mean to govern. They promise to be good masters, but they mean to be masters.-Daniel Webster

Share this post


Link to post
Share on other sites



I'm parsing out the returned array for this function, and continue to get the ==> Subscript used with non-Array variable.: error. I've checked up & down for problems...I seem to be opening & naming & referencing properly, but perhaps I'm spending too much time with this to see the error of my ways...

That function doesn't return an array if there is an error. From the function's header inside the ExcelCOM_UDF.au3 file:

; On Failure - Returns 0 (as non-array numeric value) and sets @error on errors:

; @error=1 - Specified object does not exist

; @error=2 - Invalid sheet number

; @error=3 - Invalid sheet name

Do some checking before you try to use the array:

If _ExcelSheetActivate ($Gsd_uBk, $Gsd_Unres_She) Then
    $Gsd_Un_Range = _ExcelSheetUsedRangeGet ($Gsd_uBk, $Gsd_Unres_She)
    If Not @error Then
        $Gsd_uLast_Row = $Gsd_Un_Range[3]
    Else
        MsgBox(16, "Error", "Error returned from _ExcelSheetUsedRangeGet(), @error = " & @error)
    EndIf
Else
    MsgBox(16, "Error", "Error returned from _ExcelSheetActivate(), @error = " & @error)
EndIf

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  
Followers 0