Reputation: 137
I write some URL in EXCEL file using Apache POI. This is my code:
Hyperlink link = createHelper.createHyperlink(org.apache.poi.common.usermodel.Hyperlink.LINK_URL);
link.setAddress(cellVallue);
cell1.setHyperlink(link);
When I dowload the file, I am not able to open the URL on browser and I get this message
unable to open "url". Cannot download the information you requested
But, I noticed weired behavior : when I copy and paste the url from Excel to the IE browser and I execute it. After that, I can open the url from Excel directly on IE borwser without get the message and it works fine!
Upvotes: 1
Views: 5248
Reputation: 6834
There could be couple of reasons for that as actually it is not just a regular link, I assume your link is returning some stream to download and also assuming that your hyperlink is actually working when you copy and paste it to (any) browser.
There are some known issues as you may end up adding some keys to your registry.
Short suggestion is: Try setting internet explorer as your default browser and see if it will work. That would at least give you some idea about the actual issues and you could make sure that issue is not the way you generate the link in the excel. It is something behind the scene.
If still not works , Open IE and click on Tools / Internet Options / Advanced then scroll down to the Security settings and untick the box for ‘Do not save encrypted pages to disk’ as shown below:that Internet Explorer Settings are like below:
Obviously this is not a "solution" as it is not a good idea to force your users to use a specific browser. (Personally I hate it when they do!)
There are couple other options but they all clearly mentioned in this awesome post as it is the original source of my answer anyways.
Also I would suggest to look this and this posts as well.
Upvotes: 1