Spread for ASP.NET 7.0 Product Documentation
GetExcelSheetNames(String) Method
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > FpSpread Class > GetExcelSheetNames Method : GetExcelSheetNames(String) Method


fileName
Path and filename of Excel file

Glossary Item Box

Gets an array of sheet names from the specified Excel file.

Syntax

Visual Basic (Declaration) 
Public Overloads Shared Function GetExcelSheetNames( _
   ByVal fileName As String _
) As String()
Visual Basic (Usage)Copy Code
Dim fileName As String
Dim value() As String
 
value = FpSpread.GetExcelSheetNames(fileName)
C# 
public static string[] GetExcelSheetNames( 
   string fileName
)

Parameters

fileName
Path and filename of Excel file

Return Value

String array with names of the sheets in the Excel file

Example

This example gets the names of the individual spreadsheets in a workbook of the specified Excel file.
C#Copy Code
string[] sheetNames = null;
sheetNames = FarPoint.Web.Spread.FpSpread.GetExcelSheetNames("D:\\ALM.xls");
int i;
for (i = 0; i <= sheetNames.Length - 1; i++)
{
    ListBox1.Items.Add(sheetNames[i]);
}
Visual BasicCopy Code
Dim sheetNames As String() = Nothing
sheetNames = FpSpread1.GetExcelSheetNames("D:\ALM.xls")
Dim i As Integer
For i = 0 To sheetNames.Length - 1
    ListBox1.Items.Add(sheetNames(i))
Next 

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.