UpdateLinksType doesn't work - JAVA

@controltec,

I have evaluated your issue a bit using your sample code (below) but I could not find any issue with the output files generated. When I open the SummaryBook.xlsx file into MS Excel 2007/2013, it does not prompt me “Security Warning…” with an Options button where I can enable the contents. I have attached the zipped archive (generated) that includes both the files. I am using the following sample code to generate the files to be included into the zipped archive (report2.zip (attached)):
e.g
Sample code:

import com.aspose.cells.*;
    import java.awt.*;
    import java.io.ByteArrayOutputStream;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.OutputStream;
    import java.util.Arrays;
    import java.util.List;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;

    public class test1 {

    	public static void main(String[] args) {

    		// set the aspose license
    		License license = new License();
    		//license.setLicense("Aspose.Cells.lic");

    		Workbook detailBook = generateDetailWorkbook();
    		try {
    			File file = new File("f:/Files/report2.zip");
    			FileOutputStream fop = new FileOutputStream(file);
    			ZipOutputStream zipStream = new ZipOutputStream(fop);
    			ByteArrayOutputStream out = new ByteArrayOutputStream();
    			byte[] data;
    			detailBook.save(out, SaveFormat.XLSX);
    			data = out.toByteArray();
    			zipStream.putNextEntry(new ZipEntry("DetailBook.xlsx"));
    			zipStream.write(data);
    			zipStream.closeEntry();


    			Workbook summaryBook = generateSummaryWorkbook(detailBook);
    			summaryBook.getSettings().setUpdateLinksType(UpdateLinksType.NEVER);
    			out = new ByteArrayOutputStream();
    			summaryBook.save(out, SaveFormat.XLSX);
    			data = out.toByteArray();
    			zipStream.putNextEntry(new ZipEntry("SummaryBook.xlsx"));
    			zipStream.write(data);
    			zipStream.closeEntry();
    			zipStream.close();

    			fop.close();
    		} catch (Exception e) {
    			e.printStackTrace();
    		}


    	}

    	private static Workbook generateDetailWorkbook() {

    		Workbook workbook = new Workbook(FileFormatType.XLSX);
    		workbook.setFileName("DetailBook.xlsx");

    		Worksheet worksheet = workbook.getWorksheets().get(0);
    		worksheet.setName("Info");
    		Cell cell = worksheet.getCells().get(0, 0);
    		cell.setValue("TimeStamp");

    		cell = worksheet.getCells().get(0, 1);
    		cell.setValue("Parameter Value");

    		return workbook;
    	}

    	private static Workbook generateSummaryWorkbook(Workbook detailBook) {

    		Workbook workbook = new Workbook(FileFormatType.XLSX);
    		workbook.setFileName("SummaryBook.xlsx");

    		Worksheet worksheet = workbook.getWorksheets().get(0);
    		worksheet.setName("Summary");
    		Cell cell = worksheet.getCells().get(0, 0);
    		cell.setFormula("[DetailBook.xlsx]Info!A2");
    		worksheet.getHyperlinks().add(cell.getName(), 1, 1, "DetailBook.xlsx");

    		return workbook;
    	}
    }

Could you give us more details if I understand your issue or I am missing something? You may also attach some screenshots taken in MS Excel manually to highlight the issue.
report2.zip (13.0 KB)

Thank you.

Ok, more details: I am on a mac and using Excel 2008.
Also I can’t download your report2.zip, your website says it can’t handle the request

@controltec,

Thanks for using Aspose APIs.

By security prompt, do you mean this triangle or parallelogram as shown in this image. Let us know your feedback.

I mean this warning you get when opening the workbook Screen Shot 2017-07-10 at 3.12.44 PM.png (27.4 KB)

Also this code seems to work for Excel 2013 or higher on windows.

@controltec

We have attached two Excel files (download link given below)

  • s1.xlsx
  • s2.xlsx

Please try these files with our given sample code in your environment and let us know your feedback. This will help us isolate the issue if it is related to your environment or related to your specific Excel files. Besides, we tested your issue in Excel 2007 and it also did not replicate the issue.

Java

Workbook wb = new Workbook(dirPath + "s2.xlsx");

wb.getSettings().setUpdateLinksType(UpdateLinksType.NEVER);

wb.save(dirPath + "out.xlsx");

s1 s2.zip (11.6 KB)

I cannot download your attached zip. your website won’t let me

@controltec,

We are sorry for the inconvenience. Hopefully, you can download it from dropbox link given below.

@controltec,

Please make sure you have logged in Aspose site first and then open the thread and try to download the attachment (we attached) if it works fine.

Let us know if you still find the issue with downloading the attachments.

Thank you.

I still got this Screen Shot 2017-07-12 at 7.56.35 AM.png (25.5 KB) when trying to open your s2 file.

The dropbox works, but even when logged in the original download links do not work. Please keep using dropbox if you need to send more files.

@controltec

Please provide us feedback about this post. Thank you.

I still got this Screen Shot 2017-07-12 at 7.56.35 AM.png (25.5 KB) when trying to open your s2 file.

I did.

@controltec

I am afraid, I am not able to download your image. Could you re-attach it or provide it to me via dropbox. It is strange, I am a moderator but when I download your file, it gives me this error

File: Screen Shot 2017-07-12 at 7.56.35 AM.png (25.5 KB)

Sorry, this file is private. Only visible to post creator and staff members.

It’s exactly the same image i shared a while back. here’s a re-upload Screen Shot 2017-07-12 at 7.56.35 AM.png (25.5 KB)

@controltec

Thanks for your feedback and using Aspose APIs.

Since, this issue is not related to some specific files but related to Excel 2008 for Mac alone, so we have logged it in our database for a fix.

This issue has been logged as

  • CELLSJAVA-42344 - UpdateLinksType property does not work for Excel 2008 for Mac

@controltec,

Thanks for using Aspose APIs.

We have looked into this issue and found that it should be a behavior of Excel 2008 for Mac.

Please create a file with external links and the file could be opened without warning message box in Excel 2008 for Mac. If you can create such a file, then provide it to us. We will look into this issue more.

here is the files again. SummaryBook has links to DetailBook. When opening SummaryBook I am receive the prompt even though i have setUpdateLinks to NEVER. report.zip (11.8 KB)

@controltec

Actually, we need a file that should not have a prompt in Excel 2008 for Mac and it should also have external links.

That’s my whole problem… If I could make a file like that I wouldn’t have ever made this post. I am setting UpdateLinks to NEVER and it is still giving me the prompt.

public static final int NEVER
Do not update, and do not prompt user.

This is what is stated in your documentation.

@controltec,

Actually, we are asking you to create such an Excel file manually using Microsoft Excel 2008 for Mac not with Aspose.Cells.