Table of Contents

Class ExcelSpreadsheet

Namespace
The.Office
Assembly
Instagile.Office.dll
public sealed class ExcelSpreadsheet : IDisposable
Inheritance
ExcelSpreadsheet
Implements
Inherited Members

Constructors

ExcelSpreadsheet(Stream)

public ExcelSpreadsheet(Stream fromStream)

Parameters

fromStream Stream

Fields

NUMBER_FORMAT_DATE

public const int NUMBER_FORMAT_DATE = 14

Field Value

int

NUMBER_FORMAT_DECIMAL

public const int NUMBER_FORMAT_DECIMAL = 2

Field Value

int

NUMBER_FORMAT_INTEGER

public const int NUMBER_FORMAT_INTEGER = 1

Field Value

int

Methods

CopyRow(uint, long, long)

public void CopyRow(uint sheetId, long fromRow, long toRow)

Parameters

sheetId uint
fromRow long
toRow long

CreateCellFormat(bool, bool, double, uint?, uint?, bool)

[Obsolete("Use the overload with numberFormatId and italic")]
public uint CreateCellFormat(bool border, bool bold, double fontSize, uint? fontColorARGB, uint? backgroundColorARGB, bool centre)

Parameters

border bool
bold bool
fontSize double
fontColorARGB uint?
backgroundColorARGB uint?
centre bool

Returns

uint

CreateCellFormat(bool, bool, double, uint?, uint?, bool, NumberFormatId?, bool, bool)

public uint CreateCellFormat(bool border, bool bold, double fontSize, uint? fontColorARGB, uint? backgroundColorARGB, bool centre, ExcelSpreadsheet.NumberFormatId? numberFormatId, bool italic, bool wrapText)

Parameters

border bool
bold bool
fontSize double
fontColorARGB uint?
backgroundColorARGB uint?
centre bool
numberFormatId ExcelSpreadsheet.NumberFormatId?
italic bool
wrapText bool

Returns

uint

CreateCellFormat(bool, double, uint?, uint?, bool, NumberFormatId?, bool, bool, BorderStyleValues, BorderStyleValues, BorderStyleValues, BorderStyleValues)

public uint CreateCellFormat(bool bold, double fontSize, uint? fontColorARGB, uint? backgroundColorARGB, bool centre, ExcelSpreadsheet.NumberFormatId? numberFormatId, bool italic, bool wrapText, BorderStyleValues left, BorderStyleValues top, BorderStyleValues right, BorderStyleValues bottom)

Parameters

bold bool
fontSize double
fontColorARGB uint?
backgroundColorARGB uint?
centre bool
numberFormatId ExcelSpreadsheet.NumberFormatId?
italic bool
wrapText bool
left BorderStyleValues
top BorderStyleValues
right BorderStyleValues
bottom BorderStyleValues

Returns

uint

CreateCellFormat(ExcelStyle)

public uint CreateCellFormat(ExcelStyle style)

Parameters

style ExcelStyle

Returns

uint

CreateExcelWorksheet(string)

public ExcelWorksheet CreateExcelWorksheet(string name)

Parameters

name string

Returns

ExcelWorksheet

CreateNumberFormat(string)

public ExcelSpreadsheet.NumberFormatId CreateNumberFormat(string formatCode)

Parameters

formatCode string

Returns

ExcelSpreadsheet.NumberFormatId

CreateWorksheet(string)

[Obsolete("Use CreateExcelWorksheet and call its methods")]
public uint CreateWorksheet(string name)

Parameters

name string

Returns

uint

DeleteWorksheet(uint)

public void DeleteWorksheet(uint sheetId)

Parameters

sheetId uint

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

ExtendConditionalFormattingTo(uint, int, long)

public void ExtendConditionalFormattingTo(uint sheetId, int column, long row)

Parameters

sheetId uint
column int
row long

GetColumnIndex(string)

public static int GetColumnIndex(string columnName)

Parameters

columnName string

Returns

int

GetColumnName(int)

public static string GetColumnName(int columnIndex)

Parameters

columnIndex int

Returns

string

GetRowCount(uint)

public int GetRowCount(uint sheetId)

Parameters

sheetId uint

Returns

int

MergeRange(uint, int, long, int, long)

public void MergeRange(uint sheetId, int startColumn, long startRow, int endColumn, long endRow)

Parameters

sheetId uint
startColumn int
startRow long
endColumn int
endRow long

SetCellStyle(uint, int, long, uint)

public void SetCellStyle(uint sheetId, int column, long row, uint styleIndex)

Parameters

sheetId uint
column int
row long
styleIndex uint

SetColumnWidth(uint, int, double)

public void SetColumnWidth(uint sheetId, int column, double width)

Parameters

sheetId uint
column int
width double

SetColumnWidthInPixels(uint, int, int)

public void SetColumnWidthInPixels(uint sheetId, int column, int widthInPixels)

Parameters

sheetId uint
column int
widthInPixels int

SetRowHeight(uint, long, double)

public void SetRowHeight(uint sheetId, long row, double excelHeight)

Parameters

sheetId uint
row long
excelHeight double

SetRowHeightInPixels(uint, long, int)

public void SetRowHeightInPixels(uint sheetId, long row, int heightInPixels)

Parameters

sheetId uint
row long
heightInPixels int

SetWorksheetName(uint, string)

public void SetWorksheetName(uint sheetId, string name)

Parameters

sheetId uint
name string

UnmergeRange(uint, int, long, int, long)

public void UnmergeRange(uint sheetId, int startColumn, long startRow, int endColumn, long endRow)

Parameters

sheetId uint
startColumn int
startRow long
endColumn int
endRow long

UpdateCell(uint, int, long, DateTime, uint?)

public void UpdateCell(uint sheetId, int column, long row, DateTime value, uint? styleIndex = null)

Parameters

sheetId uint
column int
row long
value DateTime
styleIndex uint?

UpdateCell(uint, int, long, decimal, uint?)

public void UpdateCell(uint sheetId, int column, long row, decimal value, uint? styleIndex = null)

Parameters

sheetId uint
column int
row long
value decimal
styleIndex uint?

UpdateCell(uint, int, long, int, uint?)

public void UpdateCell(uint sheetId, int column, long row, int value, uint? styleIndex = null)

Parameters

sheetId uint
column int
row long
value int
styleIndex uint?

UpdateCell(uint, int, long, long, uint?)

public void UpdateCell(uint sheetId, int column, long row, long value, uint? styleIndex = null)

Parameters

sheetId uint
column int
row long
value long
styleIndex uint?

UpdateCell(uint, int, long, string, uint?)

public void UpdateCell(uint sheetId, int column, long row, string value, uint? styleIndex = null)

Parameters

sheetId uint
column int
row long
value string
styleIndex uint?

UpdateCell(uint, int, long, Currency, uint?)

public void UpdateCell(uint sheetId, int column, long row, Currency value, uint? styleIndex = null)

Parameters

sheetId uint
column int
row long
value Currency
styleIndex uint?

UpdateValue(uint, int, long, DateTime)

public void UpdateValue(uint sheetId, int column, long row, DateTime value)

Parameters

sheetId uint
column int
row long
value DateTime

UpdateValue(uint, int, long, decimal)

public void UpdateValue(uint sheetId, int column, long row, decimal value)

Parameters

sheetId uint
column int
row long
value decimal

UpdateValue(uint, int, long, long)

public void UpdateValue(uint sheetId, int column, long row, long value)

Parameters

sheetId uint
column int
row long
value long

UpdateValue(uint, int, long, string?)

public void UpdateValue(uint sheetId, int column, long row, string? value)

Parameters

sheetId uint
column int
row long
value string

UpdateValue(uint, int, long, Currency)

public void UpdateValue(uint sheetId, int column, long row, Currency value)

Parameters

sheetId uint
column int
row long
value Currency