Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

Commented Unassigned: Crash when opening a file with a broken link [12727]

$
0
0
I have an .xlsx file with a cell containing "a@" - kind of a broken email address. When I try to open it using new XSSFWorkbook(file).

Exception: UrlFormatException
Invalid URI: The hostname could not be parsed.
Comments: ** Comment from web user: danielpalme **

I have the same problem.

One way to fix this issue, is to edit _XSSFHyperlink.cs_.
Replace line 85:
```
_location = target.ToString();
```

With:
```
try
{
_location = target.ToString();
}
catch (UriFormatException)
{
_location = target.OriginalString;
}
```

This works fine for me.


Viewing all articles
Browse latest Browse all 1621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>