Hi,
I think Aspose.Cells works the same way as MS Excel does. For confirmation, you may try to copy the cells range in a sheet to paste into another worksheet, you will see that it presents the same view as per the output file (generated by Aspose.Cells). Shakeel Faiz has provided you a good code segment using the Paste Special options, but after look into it, I found if I do it in MS Excel manually, I actually got the same result as Aspose.Cells provides. So, I think it is not an issue, I think for your need, you need to first use copy/paste special facility to copy/paste the column widths from source range to destination range. After this, you need to again copy/paste the range/values from source range to destination range. See the sample code below that works fine as I tested, this is the same code as Shakeel Faiz shared but I updated / added a few lines accordingly. It works fine as per your requirements.
Sample code:
string filePath = @“e:\test2\Excel to Html\Test1.xlsx”;
Workbook workbook = new Workbook(filePath, new Aspose.Cells.LoadOptions(Aspose.Cells.LoadFormat.Xlsx));
Workbook destWorkbook = new Workbook();
Worksheet destSheet = destWorkbook.Worksheets[0];
int TotalRowCount = 0;
for (int i = 0; i < workbook.Worksheets.Count; i++)
{
Worksheet sourceSheet = workbook.Worksheets[i];
Aspose.Cells.Range sourceRange = sourceSheet.Cells.MaxDisplayRange;
Aspose.Cells.Range destRange = destSheet.Cells.CreateRange(sourceRange.FirstRow + TotalRowCount, sourceRange.FirstColumn, sourceRange.RowCount, sourceRange.ColumnCount);
PasteOptions opts = new PasteOptions();
opts.PasteType = PasteType.ColumnWidths;
destRange.Copy(sourceRange, opts); //First you will copy/paste the column widths
destRange.Copy(sourceRange);//Now copy the range
TotalRowCount = sourceRange.RowCount + TotalRowCount;
}
destWorkbook.Save(filePath + “_out.html”, Aspose.Cells.SaveFormat.Html);
Thank you.