We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Xls2Doc Demo Yields Crossed-Out Cells

When I run the"Xls2Doc - Excel to Word Conversion that I downloaded at https://releases.aspose.com/words/net/, the cells in the output Word table are crossed-out. I am using a valid Aspose.Total.lic file which I copied into the Excel2Word\CSharp\bin\Debug directory, and modified the demo to reference it, but still get the X’s in the output. I also tried commenting out the code that sets the license and I still get the X’s (along with the Evaluation Only warning).
Thanks

Hi
Thanks for your inquiry. Please change ImportBorders method as shown below.

/// 
/// Import boreders from Excel cell to Word Cell
/// 
/// Destination Word cell
/// Source Excel cell
private void ImportBorders(Aspose.Words.Tables.Cell wordsCell, Aspose.Cells.Cell excelCell)
{
    // Set line style
    wordsCell.CellFormat.Borders[Aspose.Words.BorderType.Bottom].LineStyle = ConvertLineStyle(excelCell.Style.Borders[Aspose.Cells.BorderType.BottomBorder].LineStyle);
    // Set line color
    if (wordsCell.CellFormat.Borders[Aspose.Words.BorderType.Bottom].LineStyle != LineStyle.None)
        wordsCell.CellFormat.Borders[Aspose.Words.BorderType.Bottom].Color = excelCell.Style.Borders[Aspose.Cells.BorderType.BottomBorder].Color;
    wordsCell.CellFormat.Borders[Aspose.Words.BorderType.DiagonalDown].LineStyle = ConvertLineStyle(excelCell.Style.Borders[Aspose.Cells.BorderType.DiagonalDown].LineStyle);
    if (wordsCell.CellFormat.Borders[Aspose.Words.BorderType.DiagonalDown].LineStyle != LineStyle.None)
        wordsCell.CellFormat.Borders[Aspose.Words.BorderType.DiagonalDown].Color = excelCell.Style.Borders[Aspose.Cells.BorderType.DiagonalDown].Color;
    wordsCell.CellFormat.Borders[Aspose.Words.BorderType.DiagonalUp].LineStyle = ConvertLineStyle(excelCell.Style.Borders[Aspose.Cells.BorderType.DiagonalUp].LineStyle);
    if (wordsCell.CellFormat.Borders[Aspose.Words.BorderType.DiagonalUp].LineStyle != LineStyle.None)
        wordsCell.CellFormat.Borders[Aspose.Words.BorderType.DiagonalUp].Color = excelCell.Style.Borders[Aspose.Cells.BorderType.DiagonalUp].Color;
    wordsCell.CellFormat.Borders[Aspose.Words.BorderType.Left].LineStyle = ConvertLineStyle(excelCell.Style.Borders[Aspose.Cells.BorderType.LeftBorder].LineStyle);
    if (wordsCell.CellFormat.Borders[Aspose.Words.BorderType.Left].LineStyle != LineStyle.None)
        wordsCell.CellFormat.Borders[Aspose.Words.BorderType.Left].Color = excelCell.Style.Borders[Aspose.Cells.BorderType.LeftBorder].Color;
    wordsCell.CellFormat.Borders[Aspose.Words.BorderType.Right].LineStyle = ConvertLineStyle(excelCell.Style.Borders[Aspose.Cells.BorderType.RightBorder].LineStyle);
    if (wordsCell.CellFormat.Borders[Aspose.Words.BorderType.Right].LineStyle != LineStyle.None)
        wordsCell.CellFormat.Borders[Aspose.Words.BorderType.Right].Color = excelCell.Style.Borders[Aspose.Cells.BorderType.RightBorder].Color;
    wordsCell.CellFormat.Borders[Aspose.Words.BorderType.Top].LineStyle = ConvertLineStyle(excelCell.Style.Borders[Aspose.Cells.BorderType.TopBorder].LineStyle);
    if (wordsCell.CellFormat.Borders[Aspose.Words.BorderType.Top].LineStyle != LineStyle.None)
        wordsCell.CellFormat.Borders[Aspose.Words.BorderType.Top].Color = excelCell.Style.Borders[Aspose.Cells.BorderType.TopBorder].Color;
}

This should help.
Best regards.