Exception after Combine() and Save() workbooks with external references

Hi,

We have an exception running the following code (Aspose v.7.0.4.6):

string genericTemplatePath = @"1.xlsm";

string externalLinkFilePath = @"2.xlsx";

Workbook mainWorkbook = AU.AsposeCellsHelper.Instance.Open(genericTemplatePath);

Workbook userWorkbook = AU.AsposeCellsHelper.Instance.Open(externalLinkFilePath);

//This gets rid of the exception but we should not remove all the names

//currentWorkbook.Worksheets.Names.Clear();

var b1 = userWorkbook.HasExernalLinks();

//This does not helps. Furthemore, both b1 and b2 are True...

userWorkbook.RemoveExternalLinks();

var b2 = userWorkbook.HasExernalLinks();

mainWorkbook.Combine(userWorkbook);

MemoryStream ms = new MemoryStream();

//This causes the "Object reference not set to an instance of an object." at Aspose.Cells.ExternalSheetCollection.FindSupbook(Int32 refIndex)...

mainWorkbook.Save(ms, SaveFormat.Xlsx);

The files being used are attached. Please see the comments in the code. 2.xlsx contains a number of external references (names). .RemoveExternalLinks() does not work in this case. Before and after .HasExternalLinks() method returns True. Anyway, I think there should be no exception in any cases.

Could you please look into it asap as we experience the issue in production.

Thanks,
Leo

Hi,

Thanks for providing the source files and the sample code.

I was able to replicate the problem using the code below with the latest version:
Aspose.Cells
for .NET v7.0.4.6



We have logged this issue in our database. Once the issue is fixed or we get some update, we will let you know asap.

This issue has been logged as CELLSNET-40290.

C#


string genericTemplatePath = @“F:\Shak-Data-RW\Downloads\1.xlsm”;


string externalLinkFilePath = @“F:\Shak-Data-RW\Downloads\2.xlsx”;


Workbook mainWorkbook = new Workbook(genericTemplatePath);


Workbook userWorkbook = new Workbook(externalLinkFilePath);


//This gets rid of the exception but we should not remove all the names


///currentWorkbook.Worksheets.Names.Clear();


var b1 = userWorkbook.HasExernalLinks();


//This does not helps. Furthemore, both b1 and b2 are True…


userWorkbook.RemoveExternalLinks();


var b2 = userWorkbook.HasExernalLinks();


mainWorkbook.Combine(userWorkbook);


MemoryStream ms = new MemoryStream();


//This causes the “Object reference not set to an instance of an object.” at Aspose.Cells.ExternalSheetCollection.FindSupbook(Int32 refIndex)…


mainWorkbook.Save(ms, SaveFormat.Xlsx);



Hi,

Can you please provide an update. We do experience the issue in production and it has severe consequences for our business.

Thanks,
Leo

Hi Leo,


Your issue is under evaluation/investigation, we are working on your issue. Once we figure it out, we will let you know here immediately. If it takes more days, we may provide you an eta for it.

Thank you.

Hi,

Please download and try this fix: Aspose.Cells for .NET v7.1.0.1

Thanks Shakeel, it seems to be working. We will continue our testing.

Hi,

The issue is fixed in v.7.1.0.1 but we did not upgrade to the latest version as we experienced a number of problems (mostly because of http://www.aspose.com/community/forums/355229/antivirus-software-strips-out-excel-files-from-email/showthread.aspx#355229). So we downgraded to v.6.0.1.7 in production. Is there a chance to find a workaround for the issue and get it working on v.6.0.1.7 as well?

Please move this thread to priority support forum (created here by mistake) - don't want to create a new thread there.

Thanks,
Leo

Hi,

I have logged your comment/feedback against the issue id: CELLSNET-40290

Please also try the latest version:
Aspose.Cells
for .NET v7.1.0.2

and let us know your feedback.

FYI: Your issue is always logged as Priority Issue even if you will post in a regular forum because of the Priority Issue logo below your user name.

Many thanks Shakeel. Can you also consider providing a v.6.0.1.7 + the issue’s fix if there is no any reliable workaround.

Hi,

It is our policy to provide fixes based on latest version. So I don’t think, the fix based on older versions will be provided.

But I have logged your comment so that your issue could be reviewed and answered by development team.

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.