We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Control UpdateLinks option when opening an Excel file via Aspose.Cells for .NET

When opening an Excel workbook programatically using the Excel object model, there are various options that you can specify. For example, this is a command in our current code that I’m in the process of replacing:

oWkBook = oXLApp.Workbooks.Open(FileName, Password:=Trim(mPassword), ReadOnly:=True, UpdateLinks:=False, Converter:=True, IgnoreReadOnlyRecommended:=True)

Using Aspose.Cells, how can I specify these options (particularly the UpdateLinks:=False one)? I can see from the documentation that there is an enumerator for this (WorkbookSettings.UpdateLinksType) but I can’t see how to use it for this purpose.

I currently have this:

                            Dim loadOptions As New LoadOptions
                        If mPassword.Length > 0 Then
                            loadOptions.Password = mPassword
                        End If

                        Dim spreadSheet As Workbook = New Workbook(fileOriginalName, loadOptions)

Thanks…

@DuncanL,

Thanks for sharing some details and code segment.

I think you may try to add the following line after instantiating the workbook:
e.g
Sample code:

spreadSheet.Settings.UpdateLinksType = UpdateLinksType.Never

Hope, this helps a bit.

Thanks for the suggestion. Does that not run the risk of the links still trying to update straight away when the file is instantiated, though?

@DuncanL,

I think you may try it and if you find any issue, let us know with details, sample files and sample code, we will check it soon.