Hi Eric Strehl,
Thank you for using Syncfusion products.
We do not have any custom method to export the Excel sheet data to an 2D array. So we have created an workaround to loop through the rows and column of an sheet data and export into an 2D array.
Please make use of the below code for the same.
Code Snippet [C#]:
IWorksheet worksheet = workbook.Worksheets[0];
IRange range = worksheet.UsedRange;
int lastRow = range.LastRow;
int lastColumn = range.LastColumn;
// Instantiate a new two-dimensional string array.
string[,] dataArray = new string[lastRow, lastColumn];
for (int i = 1; i <= lastRow; i++)
{
for (int j = 1; j <= lastColumn; j++)
{
//Exporting the data to an 2D array
dataArray[i - 1, j - 1] = worksheet.Range[i, j].DisplayText;
}
}
Please try the above code snippet and let us know if these helps you.
As mentioned in your last post, if you are still facing an issue with Value,Value2 and Text properties are null for the used range is null then could you please get back to us with the simple sample (The excel file and the source code used to read excel cells) which reproduces this issue so that we are able to proceed further on this..
Please let us know if need any further assistance.
Thanks,
Sridhar.S