#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)
Change History (7)
by , on Dec 26, 2013 at 12:22:48 AM
| Attachment: | Excel_AutoIt_Bug.au3 added |
|---|
by , on Dec 26, 2013 at 12:23:27 AM
| Attachment: | Excel_AutoIt_Bug.xls added |
|---|
comment:1 by , on Dec 26, 2013 at 4:16:29 PM
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:3 by , on Dec 26, 2013 at 4:57:26 PM
| Version: | 3.3.8.1 → 3.3.10.0 |
|---|
comment:5 by , on Jan 20, 2014 at 7:22:25 AM
| Resolution: | → Wont Fix |
|---|---|
| Status: | new → closed |
Won't be fixed because the next Beta of Autoit will include a completely rewritten Excel UDF.

Dummy Excel File