Skip to content

LoadFromArrays

AdrianEPPlus edited this page Sep 2, 2024 · 2 revisions

The LoadFromArrays method provides an easy way of loading an IEnumerable<object[]> into a range on a worksheet.

Overview

varlist=newList<object[]>{newobject[]{1,2,3},newobject[]{4,5,6},newobject[]{7,8,9}};usingvarpackage=newExcelPackage();varsheet=package.Workbook.Worksheets.Add("Sheet 1");varimportedRange=sheet.Cells["A1"].LoadFromArrays(list);

InsertCols1

Transpose

You can also load the data transposed from an array by using the LoadFromArraysTransposed method.

sheet.Cells["A1"].LoadFromArraysTransposed(list);

See also

EPPlus wiki

Versions

Worksheet & Ranges

Styling

Import/Export data

Formulas and filters

Charts & Drawing objects

Tables & Pivot Tables

VBA & Protection

Clone this wiki locally