This project has moved and is read-only. For the latest updates, please go here.

Does ExcelRange.Value support an object array?

Nov 8, 2010 at 5:06 PM

Thank you for your excellent library.

I am converting a web report in EPPlus that was originally written and working using Interop.
When I try the following code, I don't get the results I expected.
Am I using EPPlus correctly?

object[,] oData = new object[2, 3];
for (int j = 0; j < oData.GetUpperBound(0) + 1; j++) {
   for (int i = 0; i < oData.GetUpperBound(1) + 1; i++) {
      oData[j, i] = "";

ExcelRange rg = worksheet.Cells["A27"];
oData[0, 1] = "Data in Object Array";
rg = worksheet.Cells["A27"];
rg.Value = oData;  // Result in spreadsheet: System.Object[,]
worksheet.Cells["A28"].Value = oData;  // Result in spreadsheet: System.Object[,]
worksheet.Cells["A29"].Value = "Data in Object Array"; // Result is as expected.

Thank you.

Nov 9, 2010 at 7:40 AM


I have no support for setting multiple values using an array, but that is actully a good idea.

I'll add it to my TODO list


Nov 9, 2010 at 1:44 PM

Thank you Jan.