Table of Contents

ExcelFile.GetSheetIndex Method

Overloads

ExcelFile.GetSheetIndex(String)

Finds a sheet name on the workbook and returns its index. If it doesn't find the sheet it will raise an exception. See GetSheetIndex(String, Boolean) for a method that will not throw an exception. To change the active sheet by the name, use ActiveSheetByName. See also GetSheetName

Syntax

Namespace: FlexCel.Core

public Int32 GetSheetIndex(String sheetName)

Parameters

<-> Parameter Type Description
sheetName String Sheet you want to find.

Returns

The sheet index (1-based) if the sheet exists, or throws an Exception otherwise.

See also

ExcelFile.GetSheetIndex(String, Boolean)

Finds a sheet name on the workbook and returns its index. Depending on the "throwException" parameter, this method will raise an exception or return -1 if the sheet does not exist. To change the active sheet by the name, use ActiveSheetByName. See also GetSheetName

Syntax

Namespace: FlexCel.Core

public abstract Int32 GetSheetIndex(String sheetName, Boolean throwException)

Parameters

<-> Parameter Type Description
sheetName String Sheet you want to find.
throwException Boolean When sheetName does not exist, having throwException = true will raise an Exception. throwException = false will return -1 if the sheet is not found.

See also