web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Read Excel file using OpenXMLSDK Dynamics 365(AX-7)

Sheikh Sohail Profile Picture Sheikh Sohail 6,125


Following is code you can use to read Excel using Open XML.






using DocumentFormat.OpenXml;
using System;
using System.Linq;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;

public class SLAX7_ImportClass
{

public void testRun()
{
OXMLSpreadsheetDocument_RU document = OXMLSpreadsheetDocument_RU::construct("C:\\AX\\Test.xlsx");
OXMLWorkBook_RU workbook = OXMLWorkBook_RU::construct(document);

OXMLWorksheet_RU worksheet = workbook.getWorksheet(1);

OXMLRow_RU row = worksheet.row(1);
OXMLCell_RU cell = Row.cell(1);
Global::info(strFmt('%1',cell.getValue()));

}

}

This was originally posted here.

Comments

*This post is locked for comments