Hello,
today i have an Problem wit reading Excel-Files in Dynamics AX 4.0 and Office 2016 via X++.
My Code looks like this:
filename = "C:\\temp\\Mappe1.xlsx";
application = SysExcelApplication::construct();
workbooks = application.workbooks();
try
{
workbooks.open(filename,0,true);
}
catch (Exception::Error)
{
throw error("File cannot be opened.");
}
workbook = workbooks.item(1);
worksheets = workbook.worksheets();
worksheet = worksheets.itemFromNum(1);
cells = worksheet.cells();
But i can not read the Excel File. AX returns an Error like
Methode 'open' im COM-Objekt der Klasse 'Workbooks' hat Fehlercode 0x80010105 (<unbekannt>) zurückgegeben, das bedeutet: <unbekannt>.
Can someone help me?
*This post is locked for comments
I have the same question (0)