Cells - Worksheets.Copy source seems to use compatibility mode

When executing the following statement to transfer a sheet from a source workbook to destination workbook, the source is treated as a prior version and loses some of the features of later versions(in our example, comments beyond the old column limit are corrupted)

finalWorkbook.Worksheets[i].Copy(workbookSource.Worksheets[j]);

We believe the method needs to be updated. Are there alternatives that we can try?

Hi,


Thanks for providing us details.

Please try our latest version/fix: Aspose.Cells for .NET v8.8.2.6 if it makes any difference.

If you still have any issue, kindly do provide us your source and destination Excel files. Also provide more details which worksheet you are copying, we will check it soon.

Thank you.

Thanks,

We tried the latest version and the error when opening is no longer a problem, however, all comments after column IV in the copied worksheet are now missing.

Here is the code we used to test,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AsposeCopySheet
{
using Aspose.Cells;

class Program
{
    /// <summary>
    /// Mains the specified arguments.
    /// </summary>
    /// <param name="args">The arguments.
    static void Main(string[] args)
    {
        var workbook = new Workbook("./workbook.xlsx");

        var sheet = workbook.Worksheets[0];

        var newWorkbook = new Workbook();

        newWorkbook.Worksheets.Add();
        newWorkbook.Worksheets[0].Copy(sheet);

        newWorkbook.Save("newWorkbook.xlsx");
    }
}

}



Hi,


Thanks for providing us template file and sample code.

After an initial test, I observed the issue as you mentioned by using your sample code with your template file. I found all comments after IV column are missing in the copied sheet when using Worksheet.Copy() method.
e.g
Sample code:

var workbook = new Workbook(“e:\test2\workbook.xlsx”);

var sheet = workbook.Worksheets[0];

var newWorkbook = new Workbook(FileFormatType.Xlsx);

newWorkbook.Worksheets.Add();
newWorkbook.Worksheets[0].Copy(sheet);

newWorkbook.Save(“e:\test2\out1.xlsx”);

I have logged a ticket with an id “CELLSNET-44577” for your issue. We will look into your issue soon.

Once we have an update on it, we will let you know here.

Thank you.


Hi,

Thanks for using Aspose.Cells.

This is to inform you that we have fixed your issue CELLSNET-44577 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v8.8.3.6 and let us know your feedback.

The update worked for us. Thanks.

Hi,

Thanks for your feedback and using Aspose.Cells.

It is good to know that your issue is resolved with the latest fix. Let us know if you encounter any other issue, we will be glad to look into it and help you further.

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


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