ThisWorkbook.UpdateLinks property value is lost/reset after using Aspose

We use Aspose.Cells 8.0.2 for Java.

1. We have an Excel file with the ThisWorkbook.UpdateLinks property manually set to "2 - xlUpdateLinksNever" using Excel's VB Editor's Properties pane. After re-saving the file using Aspose, this value is reverted to "1 - xlUpdateLinksUserSetting". Is this the expected behavior?

2. How to get and set the properties for ThisWorkbook in Aspose, as seen in Excel VB Editor's Properties pane?

Thanks.

Hi Simon,

Thanks for your posting and using Aspose.Cells.

It might be a bug in Aspose.Cells. Please download and try the latest version: Aspose.Cells
for Java v8.2.0.4
and see if it makes any difference.

If your issue still occurs, then please provide us your source Excel file causing this issue. We will look into it and help you asap.

In case, it is a bug, we will log it in our database so that this issue could be fixed in our next versions.

Hi Shakeel,


The result is the same with v8.2.0.4,

Attached UpdateLinks_BeforeAspose.xlsx is the Excel file which can reproduce the issue. Observe that ThisWorkbook.UpdateLinks is originally set to 2 in this file.

After running the following code, which simply re-saves the file using Aspose…

package asposetest;

import java.io.InputStream;

import com.aspose.cells.License;
import com.aspose.cells.Workbook;

public class AsposeTest {

<span style="color: rgb(128, 0, 0); font-weight: bold;">private</span> <span style="color: rgb(128, 0, 0); font-weight: bold;">static</span> <span style="color: rgb(128, 0, 0); font-weight: bold;">final</span> <span style="color: rgb(187, 121, 119); font-weight: bold;">String</span> LICENSE_RESOURCE_PATH <span style="color: rgb(128, 128, 48);">=</span> <span style="color: rgb(0, 0, 230);">"/lib/Aspose.Cells.lic"</span><span style="color: rgb(128, 0, 128);">;</span>

<span style="color: rgb(128, 0, 0); font-weight: bold;">public</span> <span style="color: rgb(128, 0, 0); font-weight: bold;">static</span> <span style="color: rgb(187, 121, 119);">void</span> main<span style="color: rgb(128, 128, 48);">(</span><span style="color: rgb(187, 121, 119); font-weight: bold;">String</span><span style="color: rgb(128, 128, 48);">[</span><span style="color: rgb(128, 128, 48);">]</span> args<span style="color: rgb(128, 128, 48);">)</span> <span style="color: rgb(128, 0, 0); font-weight: bold;">throws</span> <span style="color: rgb(187, 121, 119); font-weight: bold;">Exception</span> <span style="color: rgb(128, 0, 128);">{</span>
	
	<span style="color: rgb(105, 105, 105);">// Apply license.</span>
	<span style="color: rgb(128, 0, 0); font-weight: bold;">final</span> License license <span style="color: rgb(128, 128, 48);">=</span> <span style="color: rgb(128, 0, 0); font-weight: bold;">new</span> License<span style="color: rgb(128, 128, 48);">(</span><span style="color: rgb(128, 128, 48);">)</span><span style="color: rgb(128, 0, 128);">;</span>
	<span style="color: rgb(128, 0, 0); font-weight: bold;">final</span> <span style="color: rgb(187, 121, 119); font-weight: bold;">InputStream</span> licenseStream <span style="color: rgb(128, 128, 48);">=</span> AsposeTest<span style="color: rgb(128, 128, 48);">.</span>class<span style="color: rgb(128, 128, 48);">.</span>getResourceAsStream<span style="color: rgb(128, 128, 48);">(</span>LICENSE_RESOURCE_PATH<span style="color: rgb(128, 128, 48);">)</span><span style="color: rgb(128, 0, 128);">;</span>
	license<span style="color: rgb(128, 128, 48);">.</span>setLicense<span style="color: rgb(128, 128, 48);">(</span>licenseStream<span style="color: rgb(128, 128, 48);">)</span><span style="color: rgb(128, 0, 128);">;</span>
	
	<span style="color: rgb(105, 105, 105);">// Open Excel file.</span>
	<span style="color: rgb(128, 0, 0); font-weight: bold;">final</span> Workbook workbook <span style="color: rgb(128, 128, 48);">=</span> <span style="color: rgb(128, 0, 0); font-weight: bold;">new</span> Workbook<span style="color: rgb(128, 128, 48);">(</span><span style="color: rgb(0, 0, 230);">"C:</span><span style="color: rgb(15, 105, 255);">\\</span><span style="color: rgb(0, 0, 230);">Temp</span><span style="color: rgb(15, 105, 255);">\\</span><span style="color: rgb(0, 0, 230);">UpdateLinks_BeforeAspose.xlsx"</span><span style="color: rgb(128, 128, 48);">)</span><span style="color: rgb(128, 0, 128);">;</span>

	<span style="color: rgb(105, 105, 105);">// Save Excel file.</span>
	workbook<span style="color: rgb(128, 128, 48);">.</span>save<span style="color: rgb(128, 128, 48);">(</span><span style="color: rgb(0, 0, 230);">"C:</span><span style="color: rgb(15, 105, 255);">\\</span><span style="color: rgb(0, 0, 230);">Temp</span><span style="color: rgb(15, 105, 255);">\\</span><span style="color: rgb(0, 0, 230);">UpdateLinks_AfterAspose.xlsx"</span><span style="color: rgb(128, 128, 48);">)</span><span style="color: rgb(128, 0, 128);">;</span>
<span style="color: rgb(128, 0, 128);">}</span>

}

…the resultant UpdateLinks_AfterAspose.xlsx has its ThisWorkbook.UpdateLinks property inadvertently modified from 2 to 1.

Hi Simon,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue after opening and saving your source Excel file using the latest version: Aspose.Cells
for Java v8.2.0.4
. ThisWorkbook.UpdateLinks property value is lost/reset after using Aspose.Cells.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSJAVA-41007.

I have tested this issue with the following code. I have attached the output Excel file and screenshot highlighting this issue for a reference.

Java


String filePath = “F:\Shak-Data-RW\Downloads\UpdateLinks_BeforeAspose.xlsx”;


Workbook workbook = new Workbook(filePath);

workbook.save(filePath + “.out.xlsx”, SaveFormat.XLSX);

Hi,

Thanks for using Aspose.Cells for Java.

Please download and try this fix: Aspose.Cells for Java v8.2.1.1 and let us know your feedback.

Hi Shakeel,


Great! In v8.2.1.1, the property value is correctly retained after saving.
Thank you.

Hi Simon,

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 CELLSJAVA-41007) have been fixed in this update.


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