ワークシートがダイアログシートであるかを検索する
Contents
[
Hide
]
可能な使用シナリオ
可能な使用シナリオ
Aspose.Cellsが提供するWorksheet.Typeプロパティを使用して、シートがダイアログシートであるかどうかを見分けることができます。列挙値SheetType.Dialogが返された場合、ダイアログシートであることがわかります。
ワークシートがダイアログシートであるかを検索する
サンプルExcelファイルを読み込み、ダイアログシートを含むかどうかをチェックし、Worksheet.TypeプロパティをチェックしてSheetType.Dialogと比較し、メッセージを表示します。サンプルコードのコンソール出力も参照してください。
サンプルコード
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Load Excel file containing Dialog Sheet | |
Workbook wb = new Workbook("sampleFindIfWorksheetIsDialogSheet.xlsx"); | |
//Access first worksheet | |
Worksheet ws = wb.Worksheets[0]; | |
//Find if the sheet type is dialog and print the message | |
if (ws.Type == SheetType.Dialog) | |
{ | |
Console.WriteLine("Worksheet is a Dialog Sheet."); | |
} |
コンソール出力
Worksheet is a Dialog Sheet.