Gurus,
I'm getting @error = 3 on _Excell_BookOpen on an AutoIt Version 3.0 console app and I don't know what I'm doing wrong. I haven't found any working examples of just reading through an existing spreadsheet. Any help would be greatly appreciated.
It's an Excel 365 spreadsheet on Windows 10. Here is my code sample:
#include <Excel.au3>
$sourceFile = "Duplicates.xlsx"
If Not FileExists($sourceFile) Then
ConsoleWrite("Oops, don't see '" & $sourceFile & "'" & @LF)
Exit
EndIf
$oExcel = _Excel_Open();False,False,False,False,False) ; hidden instance
If @error Then
ConsoleWrite("Failed to open spreadsheet")
Exit
EndIf
$oWorkbook = _Excel_BookOpen($oExcel,$sourceFile,True,False) ; readonly
If @error Then
ConsoleWrite("Excel UDF: _Excel_BookOpen, Error opening '" & $sourceFile & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
_Excel_Close($oExcel)
Exit
EndIf
Doing a Test Run or running the commandline compiled exe I get
What am I doing wrong?
MP1454