Export Comments while Saving Excel file to HTML
Contents
[
Hide
]
Export Comments while Saving Excel file to HTML
When Excel is converted to HTML, comments are not exported. Aspose.Cells for Python via Java provides the feature to export comments during Excel to HTML conversion. To achieve this, the API provides the HtmlSaveOptions.IsExportComments property. Setting the value of HtmlSaveOptions.IsExportComments property to True will export comments in the output HTML.
The following screenshot shows the output HTML file generated by the sample code snippet.
The following sample code demonstrates exporting comments during Excel to HTML conversion.
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
source_directory = "Examples/SampleFiles/SourceDirectory/" | |
output_directory = "Examples/SampleFiles/OutputDirectory/" | |
# Load the Sample Workbook | |
workbook = Workbook(source_directory + "sampleExportCommentsHTML.xlsx") | |
# Initialize HtmlSaveOptions | |
saveOptions = HtmlSaveOptions() | |
saveOptions.setExportComments(True) | |
# Save the excel file. | |
workbook.save(output_directory + "outputExportCommentsHTML.html", saveOptions) |