Establecer el comentario de una tabla o un objeto de lista dentro de la hoja de cálculo
Contents
[
Hide
]
Puede establecer el comentario de la Tabla u Objeto de Lista dentro de la hoja de cálculo utilizando la propiedad ListObject.Comment. El comentario será visible dentro del archivo xl/tables/tableName.xml.
Establecer el Comentario de la Tabla o Objeto de Lista dentro de la Hoja de Cálculo
El siguiente código de ejemplo carga el archivo de Excel de origen, establece el comentario de la primera tabla u objeto de lista dentro de la hoja de cálculo.
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 | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Open the template file. | |
Workbook workbook = new Workbook(dataDir + "source.xlsx"); | |
// Access first worksheet. | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Access first list object or table. | |
ListObject lstObj = worksheet.ListObjects[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); |