Spread ASP.NET 6.0 Product Documentation
GetExcelSheetNames(Stream) Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > FpSpread Class > GetExcelSheetNames Method : GetExcelSheetNames(Stream) Method


stream
Stream containing an Excel Compound Storage file

Glossary Item Box

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

Syntax

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

Parameters

stream
Stream containing an Excel Compound Storage 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 stream.
C#Copy Code
string f;
f = "D:\\formula1.xls";
System.IO.FileStream s = new System.IO.FileStream(f, System.IO.FileMode.Open, System.IO.FileAccess.Read);
string[] sheetNames = null;
sheetNames = FarPoint.Web.Spread.FpSpread.GetExcelSheetNames(s);
int i;
for (i = 0; i <= sheetNames.Length - 1; i++)
{
    ListBox1.Items.Add(sheetNames[i]);
}
Visual BasicCopy Code
Dim f As String
f = "D:\formula1.xls"
Dim s As New System.IO.FileStream(f, System.IO.FileMode.Open, System.IO.FileAccess.Read)
Dim sheetNames As String()
sheetNames = FpSpread1.GetExcelSheetNames(s)
Dim i As Integer
For i = 0 To sheetNames.Length - 1
    ListBox1.Items.Add(sheetNames(i)) 
Next

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.