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: khamulete **
Exception: UrlFormatException
Invalid URI: The hostname could not be parsed.
Comments: ** Comment from web user: khamulete **
This is happening to me as well with a xlsx file to create a XSSFWorkbook.
The problem occurs when the cell has hyperlink format, which is given automatically by Excel when the '@' character is writen. Otherwise, when the information is kept without URI format (not hyperlink), the constructor works fine:
```
using (FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read))
{
try
{
XSSFWorkbook xssfworkbook = new XSSFWorkbook(file);
return xssfworkbook;
}
catch (Exception ex)
{
//error stuff
}
}
```