Free Support Forum - aspose.com

Cell containing Bold text and Normal text being replaced by another cell value in Excel file

Hello,

We are having issue with the excel file when a cell that has both BOLD and Normal text is getting replaced with another cell value.I have attached the test file (testfile.xlsx)and the resulting files (testfile_1.xlsx and testfile_2.xlsx). In this test file(testfile.xlsx) , text in row 16 is getting replaced with row 1 text. We are using Aspose.Cells for .NET (version 5.3.1.2). Here is the sample code:

-----------------------------------------------------------

Workbook wb = new Workbook(@"c:\files\ testfile.xlsx");<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Workbook wb2 = new Workbook(FileFormatType.Xlsx);

License lic = new License();

lic.SetLicense(@"C:\Licenses\Aspose.Cells.lic");

List ws = new List();

ws.Add(wb.Worksheets[0]);

wb2.Worksheets.Clear();

foreach (Worksheet wsht in ws)

{

wb2.Worksheets.Add();

wb2.Worksheets[wb2.Worksheets.Count - 1].Copy(wsht);

}

wb.Save(@"c:\files\ testfile_1.xlsx", SaveFormat.Xlsx); // this has correct info on row 16.

wb2.Save(@"c:\files\ testfile_2.xlsx", SaveFormat.Xlsx); // Incorrect info on row16.

--------------------------------------------------------------.

Thanks,
Sandeep

Hi,

I can reproduce this issue with latest version Aspose.Cells for .NET v5.3.1.2.

I have attached the output source and destination xlsx files. Below is my C# code.

This issue has been logged as CELLSNET-25554.

C#


Workbook sourceWorkbook = new Workbook(@“F:\Downloads\testfile.xlsx”);

Workbook destWorkbook = new Workbook();


destWorkbook.Worksheets.Clear();


foreach (Worksheet sourceSheet in sourceWorkbook.Worksheets)

{

destWorkbook.Worksheets.Add();

destWorkbook.Worksheets[destWorkbook.Worksheets.Count - 1].Copy(sourceSheet);

}


sourceWorkbook.Save(@“F:\Downloads\issue\sourceOutput.xlsx”, SaveFormat.Xlsx);

destWorkbook.Save(@“F:\Downloads\issue\destOutput.xlsx”, SaveFormat.Xlsx);

Hi,

Please try the attached version Aspose.Cells for .NET (Latest Version) . We have fixed the issue you
mentioned.

Hi,

We are still having the same issue with the new dll you have provided. Can you please take a look at it? I have attached another test file (anothertestfile.xlsx) where Line 11 gets replaced by Line 1

Thanks,
Sandeep

Hi,

Is it your input file or output file? I tried your code with it thinking it as input file, it works fine. Also, kindly give us both the files (input + output) with sample code here, we will check it soon. Moreover, you may attach screen_shots to point out the issue accurately.

Thank you.

Hi,

Its working now.

Thanks,
Sandeep

Hello,

We are now having issue with the excel file when a grey shaded table structure is showing up after line 33. I have attached the input file (input.xlsx)and the resulting files (source_output.xlsx and destination_output.xlsx). We are using Aspose.Cells for .NET provided in the post above (5.3.1.4)

Here is the sample code:

-----------------------------------------------------------

Workbook wb = new Workbook(@"c:\files\ input.xlsx");

Workbook wb2 = new Workbook(FileFormatType.Xlsx);

License lic = new License();

lic.SetLicense(@"C:\Licenses\Aspose.Cells.lic");

List ws = new List();

ws.Add(wb.Worksheets[0]);

wb2.Worksheets.Clear();

foreach (Worksheet wsht in ws)

{

wb2.Worksheets.Add();

wb2.Worksheets[wb2.Worksheets.Count - 1].Copy(wsht);

}

wb.Save(@"c:\files\ source_output.xlsx", SaveFormat.Xlsx); // this has correct info and no grey area.

wb2.Save(@"c:\files\ destination_output.xlsx", SaveFormat.Xlsx); // this has a greyed table showing up fromline 33.

--------------------------------------------------------------.

Thanks,
Sandeep

Hi,

Thanks for providing us template files with code.

I have tested your issue with your template file and code and found the issue as you have mentioned after initial test.

I have reopened your ticket “CELLSNET-25554” again. We will figure it out soon.

Thank you.

Hi,

Please try the attached version Aspose.Cells for .NET (Latest Version) . We have fixed the issue you
mentioned.

The issues you have found earlier (filed as CELLSNET-25554) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

We are planning to move our web server to a 64 bit machine. Can we use the existing aspose dll for .NET (version v5.3.1.7)? Else could you provide us a 64 bit dll.

Thanks,
Sandeep

Hi,

You can use current Aspose.Cells for .NET assembly safely on your 64 bit machine.

After you install Aspose.Cells, you can find 2 DLLS in the Bin folder.
To work for 64 bit machine, please use the dll for .Net2.0.

Let us know if you find any problem.