Excel et CSharp avec EPPlus

De Banane Atomic
Aller à la navigationAller à la recherche

Liens

Bases

Cs.svg
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;

using (var package = new ExcelPackage(new FileInfo(@"C:\folder\file.xlsx")))
{
    var workbook = package.Workbook;
    var worksheet = workbook.Worksheets[0];
    // row, col, row, col
    worksheet.Cells[1, 1, 3, 3].Sort(1); // sort by column 1 (0-based) the selected range

    package.Save();
}