Error with AcceptAllRevisions on document

We are getting an error (System.ArgumentException : Destination array was not long enough...) trying to accept all revisions on the attached Excel file (from a client). It can be reproduced with the following code:

var filePath = "pathToDocument";
using var workbook = new Workbook(filePath);
if (workbook.HasRevisions)
{ 
    workbook.AcceptAllRevisions();
}

Please let me know if you need further information

3_2068344-Copy.zip (4.7 MB)

@lauramoon
We have reproduced the issue with the provided resources. We 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-56160

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.

@lauramoon
If you want to accept all revisions, please simply call workbook.AcceptAllRevisions():

using var workbook = new Workbook(filePath);
workbook.AcceptAllRevisions();

Yes, AcceptAllRevisions normally works, but not for the (confidential client) document attached to the first post.

@lauramoon,

I used your template XLSX file (you attached to the first post in the thread) and it worked fine and I do not get any error.
e.g.,
Sample code:

var filePath = "e:\\test2\\3_2068344-Copy.xlsx";
using var workbook = new Workbook(filePath);
workbook.AcceptAllRevisions();

Which version of the API you are using? I am using Aspose.Cells for .NET v24.6.

I tested the document on 24.6.0.

I found if I first opened the document in Excel and clicked ‘Unshare Workbook’ under Review → Protect, then AcceptAllRevisions would not error.

But it is erroring if I do not unshare it that first. And we cannot open the document in Excel with our software.

My apologies. It appears that HasRevisions is erroring, not AcceptAllRevisions.

We include the HasRevisions check before running AcceptAllRevisions, because we have gotten errors in the past on other documents without that check.

Can you verify that HasRevisions errors on the document?

@lauramoon,

Yes, when including the HasRevisions check, we reproduced the issue you mentioned. We have already logged a ticket with the ID “CELLSNET-56160” for the issue in our database. We have provided you with a workaround (directly calling AcceptAllRevisions without the HasRevisions check) to cope with your issue for the time being. We will be looking into your issue (“CELLSNET-56160”) and will get back to you once we resolve the issue or have some other updates on it.

Got it, thank you.

@lauramoon,

You are welcome.

@lauramoon,

This is to inform you that your issue (Ticket ID: “CELLSNET-56160”) has been resolved. The fix will be included in our upcoming release (Aspose.Cells v24.8) which we plan to release in the first half of August 2024. We will notify you when the next release is published.

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