Hi,
Thanks for the screen shot and some details.
Please try our latest version/ fix: Aspose.Cells for .NET v8.6.1.1
I have evaluated your scenario/ case a bit. I used a simple template file (attached) with the following sample code, it works fine. I generated both XLSX and HTML files, both are fine. I have attached the output HTML file in the attached archive for your reference:
e.g
Sample code:
Workbook workbook = new Workbook(“e:\test2\Bkbordermerge.xlsx”);
Worksheet worksheet = workbook.Worksheets[0];
//Formatting cells and ranges.
//Creating a range that spans over the all data cells of a worksheet
var range = worksheet.Cells.CreateRange(“B3”, “E6”);
//Create a Style object.
Style colstyle = workbook.CreateStyle();
colstyle.Borders[BorderType.LeftBorder].LineStyle = CellBorderType.Thin;
colstyle.Borders[BorderType.RightBorder].LineStyle = CellBorderType.Thin;
colstyle.Borders[BorderType.TopBorder].LineStyle = CellBorderType.Thin;
colstyle.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin;
colstyle.HorizontalAlignment = TextAlignmentType.Center;
StyleFlag flag = new StyleFlag();
flag.Borders = true;
//Apply the style to the range
range.ApplyStyle(colstyle, flag);
workbook.Save(“e:\test2\output1__mergedcells.xlsx”);
workbook.Save(“e:\test2\output1_mergedbordercells.html”, SaveFormat.Html);
If you still find the issue with v8.6.1.1, I am afraid, we need a simple console application (runnable) with your template file(s) (if there is any) to reproduce the issue on our end. We will check it soon.
Thank you.