ワークシートがダイアログシートであるかを検索する
Contents
[
Hide
]
可能な使用シナリオ
可能な使用シナリオ
Aspose.Cells for Python via .NETが提供する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
from aspose.cells import SheetType, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# Load Excel file containing Dialog Sheet | |
wb = Workbook("sampleFindIfWorksheetIsDialogSheet.xlsx") | |
# Access first worksheet | |
ws = wb.worksheets[0] | |
# Find if the sheet type is dialog and print the message | |
if ws.type == SheetType.DIALOG: | |
print("Worksheet is a Dialog Sheet.") |
コンソール出力
Worksheet is a Dialog Sheet.