查找工作表是否为对话框表
Contents
[
Hide
]
可能的使用场景
对话框工作表是一种包含对话框的旧工作表格式。此类工作表可以由旧版本的 Microsoft Excel(例如 2003)插入,如屏幕截图所示。它也可以在较新版本中使用 VBA 插入,例如 Microsoft Excel 2016。
您可以找到工作表是对话框工作表还是其他类型的工作表工作表.类型Aspose.Cells提供的属性,如果返回枚举值图纸类型.Dialog,那么这意味着,你正在处理对话框表。
查找工作表是否为对话框表
下面的示例代码加载示例 Excel 文件包含一个对话框表。它检查工作表.类型财产将其与图纸类型.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.