TsadriuUtilities.Excel 2.1.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package TsadriuUtilities.Excel --version 2.1.2                
NuGet\Install-Package TsadriuUtilities.Excel -Version 2.1.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TsadriuUtilities.Excel" Version="2.1.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TsadriuUtilities.Excel --version 2.1.2                
#r "nuget: TsadriuUtilities.Excel, 2.1.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TsadriuUtilities.Excel as a Cake Addin
#addin nuget:?package=TsadriuUtilities.Excel&version=2.1.2

// Install TsadriuUtilities.Excel as a Cake Tool
#tool nuget:?package=TsadriuUtilities.Excel&version=2.1.2                

TsadriuUtilities.Excel

A small package that parses an Excel (XLSX only).

TsadriuUtilities.Excel is a library that helps on dealing with XLSX files, to make it easier and save a little bit of time.

> Features <

ExcelWorkbook:

To create a new instance, use IExcelWorkbook workbook = new ExcelWorkbook("fullFilePath");

  • List<IExcelSheet> SheetList { get; set; }
    • Gets or sets the IExcelSheet list of the current IExcelWorkbook.

ExcelSheet:

To create a new instance, use IExcelSheet sheet = new ExcelSheet();

  • string Name { get; set; }
    • Gets or sets the sheet name.
  • int Id { get; set; }
    • Gets or sets the sheet id (this is based on the excel's sheet order).
  • bool IsVisible { get; set; }
    • Gets or sets the visibility of a Sheet.
  • List<IExcelCell> CellList { get; set; }
    • Gets or sets the cell list.
  • int LastColumnIndex { get; set; }
    • Gets or sets the last column index. This index is 0-based.
  • int LastRowIndex { get; set; }
    • Gets or sets the last row index. This index is 0-based.
  • AddCell(IExcelCell cell):
    • Adds a IExcelCell to the sheet.
  • GetCell(Coordinate coordinate) + 2 overload:
    • Returns the IExcelCell based on the coordinate.
  • GetCellValue<T>(Coordinate coordinate):
    • Retrieves the cell's value based on the IExcelCell.Type (if the IExcelCell.Type is CellTypeEnum.Formula, it will use IExcelCell.SubType instead). Exception is thrown when the IExcelCell.Type is not the same as the T.
  • GetCellType(Coordinate coordinate, bool avoidFormulaType = true):
    • Retrieves the ExcelCell type.
    • If avoidFormulaType is set to true and IExcelCell.Type is CellTypeEnum.Formula, it will return the IExcelCell.SubType.
    • If avoidFormulaType is set to false, it returns the IExcelCell.Type, no matter what it is.
  • GetCellCoordinate(string cellValue, StringComparison comparison = StringComparison.OrdinalIgnoreCase):
    • Retrieves the Coordinate of the IExcelCell from the CellList by comparing the IExcelCell.StringValue or IExcelCell.NumericValue with the cellValue.

ExcelCell:

To create a new instance, use IExcelCell cell = new ExcelCell() + 3 overload;

  • Coordinate Coordinate { get; set; }
    • Gets or sets the cell's coordinate.
  • string StringValue { get; set; }
    • Gets or sets the cell's string/text value.
  • double NumericValue { get; set; }
    • Gets or sets the cell's numeric value. This is only available if the Type" is CellTypeEnum.Numeric.
  • DateTime DateTimeValue { get; set; }
    • Gets the cell's DateTime value. If the Type is CellTypeEnum.Numeric, it will try to convert it into a DateTime.
  • CellTypeEnum Type { get; set; }
    • Gets or sets the cell's type CellTypeEnum.String, CellTypeEnum.Numeric or CellTypeEnum.Formula).
  • CellTypeEnum SubType { get; set; }
    • Gets or sets the cell's subtype CellTypeEnum.String or CellTypeEnum.Numeric). This is used when Type is a CellTypeEnum.Formula.
  • bool IsFormula { get; set; }
    • Gets a value indicating whether the cell is a formula based on Type.
  • string FormulaValue { get; set; }
    • Gets or sets the cell's formula's value. This is only available when the IsFormula is true.
  • GetValueAsString(bool isDateTime = false):
    • Checks the cell's Type and SubType. If either is CellTypeEnum.String or CellTypeEnum.Numeric, it will return the content as a string.
    • If the cell is a DateTime, set isDateTime to true.

Coordinate:

To create a new instance, use Coordinate coordinate = new Coordinate() + 1 overload;

  • int ColumnIndex { get; set; }
    • Gets or sets the column index (0-based index).
  • int RowIndex { get; set; }
    • Gets or sets the row index (0-based index).
  • string ExcelIndex { get; set; }
    • Gets or sets the index of the column and row of the excel.
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.5.1 499 6/16/2023
2.5.0 543 2/17/2023
2.4.1 247 2/15/2023
2.4.0 254 2/15/2023
2.3.0 276 2/10/2023
2.2.1 247 2/9/2023
2.2.0 354 1/20/2023
2.1.2 359 12/14/2022
2.1.0 307 12/14/2022
2.0.0 299 12/14/2022
1.1.2 424 5/31/2022
1.1.1 399 5/31/2022
1.1.0 422 5/31/2022
1.0.2 424 5/30/2022

ExcelWorkbook:
- Added support for the culture.

ExcelCell:
- Fixed exception on parsing the numeric value into a DateTime.