Modify

Opened 12 years ago

Closed 12 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: 3.3.10.0 Severity: None
Keywords: Cc:

Description

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 12 years ago.
Excel_AutoIt_Bug.xls (13.5 KB ) - added by squishy 12 years ago.
Dummy Excel File

Download all attachments as: .zip

Change History (7)

by anonymous, 12 years ago

Attachment: Excel_AutoIt_Bug.au3 added

by squishy, 12 years ago

Attachment: Excel_AutoIt_Bug.xls added

Dummy Excel File

comment:1 by BrewManNH, 12 years ago

Version 3.3.8.1 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 3.3.10.0.

comment:2 by guinness, 12 years ago

Yes it does. Changed the version.

comment:3 by guinness, 12 years ago

Version: 3.3.8.13.3.10.0

comment:4 by guinness, 12 years ago

Your proposed fix does not actually fix the error.

comment:5 by water, 12 years ago

Resolution: Wont Fix
Status: newclosed

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

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.