GrapeCity SPREAD for Windows Forms 11.0J
GetExcelSheetNames(Stream,String) メソッド


Excel Compound Document ファイルを含むストリーム。
ファイルのパスワード。
指定したExcelストリームからシート名の配列を取得します。
構文
'Declaration
 
Public Overloads Shared Function GetExcelSheetNames( _
   ByVal stream As Stream, _
   ByVal password As String _
) As String()
'使用法
 
Dim stream As Stream
Dim password As String
Dim value() As String
 
value = FpSpread.GetExcelSheetNames(stream, password)
public static string[] GetExcelSheetNames( 
   Stream stream,
   string password
)

パラメータ

stream
Excel Compound Document ファイルを含むストリーム。
password
ファイルのパスワード。
例外
例外説明
System.ArgumentNullExceptionストリームが指定されていないか、指定されたストリームがNullです。
System.ArgumentExceptionストリームが指定されていないか、指定されたストリームが空です。
次のサンプルコードは、シート名を取得します。
string f;
f = "c:\\Book1.xlsx";
System.IO.FileStream s = new System.IO.FileStream(f, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite);

string[] sheetNames = FarPoint.Win.Spread.FpSpread.GetExcelSheetNames(s, "Test");
    int i;
for (i = 0; i < sheetNames.Length; i++)
{
    listBox1.Items.Add(sheetNames[i].ToString());
}
Dim f As String
f = "c:\Book1.xlsx"
Dim s As New System.IO.FileStream(f, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite)
Dim sheetNames As String() = FarPoint.Win.Spread.FpSpread.GetExcelSheetNames(s, "Test")
Dim i As Integer
For i = 0 To sheetNames.Length - 1

    ListBox1.Items.Add(sheetNames(i).ToString())
Next
参照

FpSpread クラス
FpSpread メンバ
オーバーロード一覧

 

 


© 2004-2018, GrapeCity Inc. All rights reserved.