Opened 9 years ago

Closed 9 years ago

#2569 closed Bug (Wont Fix)

_ExcelReadSheetToArray - Error Code 4 When Excel Object Was Attached

Reported by: squishy Owned by:
Milestone: Component: Standard UDFs
Version: Severity: None
Keywords: Cc:


The function _ExcelReadSheetToArray seems to always throw error 4 whenever called on an Excel object that was attached and not opened. I have traced the error back to line 533 in the function Excel.au3, where an ambiguous reference seems to be the issue. If you add the 'ActiveSheet' scope to the range when declaring the array, it seems to fix the issue:

Current line 533:
Local $aArray = $oExcel.ActiveSheet.Range($oExcel.Cells($iStartRow, $iStartColumn), $oExcel.Cells($iLastRow, $iLastColumn)).Value

Fixed line 533:
Local $aArray = $oExcel.ActiveSheet.Range($oExcel.ActiveSheet.Cells($iStartRow, $iStartColumn), $oExcel.ActiveSheet.Cells($iLastRow, $iLastColumn)).Value

I have included both a code file and a test Excel file for you to test out.

Attachments (2)

Excel_AutoIt_Bug.au3 (773 bytes) - added by anonymous 9 years ago.
Excel_AutoIt_Bug.xls (13.5 KB) - added by squishy 9 years ago.
Dummy Excel File

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by anonymous

Changed 9 years ago by squishy

Dummy Excel File

comment:1 Changed 9 years ago by BrewManNH

Version is no longer the current version, have you tried this on the new release version? Does it still demonstrate the problem? The newest version is

comment:2 Changed 9 years ago by guinness

Yes it does. Changed the version.

comment:3 Changed 9 years ago by guinness

  • Version changed from to

comment:4 Changed 9 years ago by guinness

Your proposed fix does not actually fix the error.

comment:5 Changed 9 years ago by water

  • Resolution set to Wont Fix
  • Status changed from new to closed

Won't be fixed because the next Beta of Autoit will include a completely rewritten Excel UDF.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.