1

I wanted to see if you can populate a range all at once from an array when using closedXML instead of populating a single cell at a time. Also, if it is possible to set a range from an array, would that be faster than looping through cell by cell and populating each cell?

leora
  • 188,729
  • 360
  • 878
  • 1,366
  • They have some comprehensive examples in the [documentation section](http://closedxml.codeplex.com/documentation). They might not have the exact solution to your question but look around and I'm sure you'll get your answer just by looking at the examples over there. – Bala R Oct 21 '11 at 03:52

2 Answers2

3

You can try to insert data as a DataTable and see if it will speed up document creation. But as I can see in source code, there is no optimisation possible whatsoever against single cell population (but I can be wrong).

Petr Abdulin
  • 33,883
  • 9
  • 62
  • 96
1

You can do:

cell.Value = yourArray;

See the section "Inserting Data/Tables" of the Documentation.

Manuel
  • 10,869
  • 14
  • 55
  • 86