Execl data not Align while replacing into Word

Excel_word_doc.zip (991.9 KB)

Hello team, I am facing data alignment issue while replacing Excel sheet data in word. Here for some sheets which contain table last row $ and formulas, this data while replacing in word it is adding one extra column and last row data is moving to that column, sample code , payload and output attached

@bkalightaspose1125

Can you please provide the sample code you are using for replacing Excel data in Word, as well as the specific Excel and Word documents involved in the issue?

@Professionalize.Discourse sample code attached, check the Zip one pls.

@bkalightaspose1125 Your input and output document are quite big. Could you please be more specific and let us know on which page in the output DOCX document the problem can be observed and to which sheet in the Excel file the problem correspond.
In addition, as I can see, you are exporting Excel data to HTML and then inert HTML into MS word document. Please check whether the problem is observed in HTML produced by Aspose.Cells.

input_outputdoc.zip (133.2 KB)

@alexey.noskov I have attached sample documents, after replacing excel data in word document you can observe table1 and table 2 last row was not aligned properly, were as table 2 data aligned with document.

@bkalightaspose1125 Thank you for additional information. It looks like the problem occurs upon exporting Excel sheets to HTML. The problem can be reproduced by the following simple code:

Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(@"C:\Temp\in.xlsx");
foreach (Aspose.Cells.Worksheet ws in wb.Worksheets)
{
    Aspose.Cells.HtmlSaveOptions htmlOptions = new Aspose.Cells.HtmlSaveOptions(Aspose.Cells.SaveFormat.Html)
    {
        ExportGridLines = true,
        ExportActiveWorksheetOnly = true,
        HiddenColDisplayType = Aspose.Cells.HtmlHiddenColDisplayType.Remove,
        HiddenRowDisplayType = Aspose.Cells.HtmlHiddenRowDisplayType.Remove
    };
    wb.Worksheets.ActiveSheetIndex = ws.Index;
    wb.Save(@$"C:\Temp\sheet_{ws.Index}.html", htmlOptions);
}

in.zip (96.1 KB)
sheet_0.zip (4.7 KB)

So, I will move your request to Aspose.Cells forum category. My colleagues from Aspose.Cells team will help you shortly.

@alexey.noskov Thank you

@bkalightaspose1125
By testing on the latest version v25.5 using sample file and code, we can reproduce the issue. Data alignment error when converting file to html.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-58388

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

We are pleased to inform you that your issue has been resolved. The fix will be included in an upcoming release (Aspose.Cells v25.6) that we plan to release in the first half of June 2025. You will be notified when the next version is released.
Here is the result after the fix for your reference: output.zip (5.3 KB)

Thank you @Eric.wang

@bkalightaspose1125
You are welcome. If you have any questions, please feel free to contact us at any time.

The issues you have found earlier (filed as CELLSNET-58388) have been fixed in this update. This message was posted using Bugs notification tool by leoluo