在工作表内设置表格或列表对象的备注

设置工作表内表格或列表对象的批注

以下示例代码加载源Excel文件,设置工作表中第一个表格或列表对象的注释。

from aspose.cells import SaveFormat, Workbook
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# The path to the documents directory.
dataDir = RunExamples.GetDataDir(".")
# Open the template file.
workbook = Workbook(dataDir + "source.xlsx")
# Access first worksheet.
worksheet = workbook.worksheets[0]
# Access first list object or table.
lstObj = worksheet.list_objects[0]
# Set the comment of the list object
lstObj.comment = "This is Aspose.Cells comment."
# Save the workbook in xlsx format
workbook.save(dataDir + "SetCommentOfTableOrListObject_out.xlsx", SaveFormat.XLSX)