Ticket #2569: Excel_AutoIt_Bug.au3

File Excel_AutoIt_Bug.au3, 773 bytes (added by anonymous, 9 years ago)
Line 
1#include <Excel.au3>
2#include <Array.au3>
3
4Global $fileExcel = "Excel_AutoIt_Bug.xls"
5Global $arrayTest,$objExcelAttached
6
7;~ _ExcelReadSheetToArray sets @error to 4 when called after the workbook object is attached
8
9$objExcelAttached = _ExcelBookAttach($fileExcel,"FileName")
10$arrayTest = _ExcelReadSheetToArray($objExcelAttached,1,1,1,8)
11If @error <> 0 Then
12        ConsoleWrite("Error encountered (" & @error & ") - object was attached and active sheet wasn't changed." & @CRLF)
13EndIf
14$objExcelAttached.Sheets(2).Activate
15$arrayTest = _ExcelReadSheetToArray($objExcelAttached,1,1,1,8)
16If @error <> 0 Then
17        ConsoleWrite("Error encountered (" & @error & ") - object was attached and active sheet was changed." & @CRLF)
18EndIf
19_ExcelBookClose($objExcelAttached)