获取工作表的唯一标识
Contents
[
Hide
]
如何获取工作表唯一ID
Aspose.Cells for Python via .NET 提供通过 Worksheet.unique_id 属性获取工作表唯一ID的功能。以下代码片段演示了如何使用 Worksheet.unique_id 属性打印工作表的唯一ID。此代码示例使用了示例Excel文件。
源代码
This file contains hidden or 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 Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# Source directory | |
sourceDir = RunExamples.Get_SourceDirectory() | |
# Load source Excel file | |
workbook = Workbook(sourceDir + "Book1.xlsx") | |
# Access first worksheet | |
worksheet = workbook.worksheets[0] | |
# Print Unique Id | |
print("Unique Id: " + worksheet.unique_id) |