Saving empty sheet with grid lines to html yields one cell being displayed


When saving empty sheets from a workbook (loaded from xlsx or ods, see the archive attached) with the following code, an empty cell is displayed in the html:

var inputPath = ...;
var targetPath = ...;

var options = new HtmlSaveOptions
    ExportGridLines = true

using (var wb = new Workbook(inputPath))
    wb.Save(targetPath, options);

cellOnEmptySheets.PNG (514 Bytes) (11.5 KB)

Is this intentional? We think it would be better not to display anything. (Tested with Aspose.Cells 20.8.0)



This is due to the fact that you have enabled exporting gridlines when rendering to HTML. Please comment the line of code:

it will work as per your needs.

But I need those grid lines (for other sheets that won’t be empty), so it was intentionally set to true.


You cannot set grid lines for empty sheets while rendering to HTML in MS Excel manually so it is useless.

But imagine the following: a workbook with two sheets, sheet1 with some content and sheet2 empty. I want to have the gridlines option active, so sheet1 looks as expected. But since the option is enabled, an empty cell will show up on sheet2 as well.


We understand your needs. As we are already able to reproduce the issue as you mentioned. By Saving empty sheet with exported grid lines settings to html gives one (blank) cell being displayed in the output. We will check if it is better to just ignore gridlines for single cell and show the sheet blank as MS Excel does this. We have logged a ticket with an id “CELLSNET-47562” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.


This is to inform you that the issue is currently fixed. After running QA and incorporating other enhancements and fixes, we will immediately provide a modified version.


Please try our latest version/fix: Aspose.Cells for .NET v20.8.9 (attached)

Your issue should be fixed in it.

Let us know your feedback.
Aspose.Cells20.8.9 For .Net2_AuthenticodeSigned.Zip (5.4 MB)
Aspose.Cells20.8.9 For .Net4.0.Zip (5.4 MB)

The issues you have found earlier (filed as CELLSNET-47562) have been fixed in Aspose.Cells for .NET v20.9. This message was posted using Bugs notification tool by Amjad_Sahi
You may also get the new version @ nuget repos. (NuGet Gallery | Aspose.Cells 20.9.0)