Ange kommentaren för tabellen eller lista objektet i arbetsbladet
Contents
[
Hide
]
Du kan ange kommentaren för tabellen eller lista objektet i arbetsbladet med hjälp av egenskapen ListObject.comment. Kommentaren kommer att vara synlig i filen xl/tables/tabellNamn.xml.
Ange kommentaren för tabell eller listobjekt inne i kalkylbladet
Följande kodexempel laddar käll-exkelfilen, anger kommentaren för den första tabellen eller listobjektet i arbetsbladet.
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 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) |