title: Exception when reading XLSM workbook via Apache POI
body: <p>I'm trying to read <code>.xlsm</code> file using Apache POI library (3.8-beta5):</p>
  
  <pre><code>Workbook wb = null;
  try {
      wb =  WorkbookFactory.create(isXLSFile);
  } catch (IOException e) {
  ...
  </code></pre>
  
  <p>nothing complicated. While generally documents are being read well, one document throws an exception: </p>
  
  <pre><code>Caused by: java.lang.IllegalStateException: A sheet hyperlink must either have a location, or a relationship. Found:
  &lt;xml-fragment ref="H13" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"/&gt;
      at org.apache.poi.xssf.usermodel.XSSFHyperlink.&lt;init&gt;(XSSFHyperlink.java:72)
      at org.apache.poi.xssf.usermodel.XSSFSheet.initHyperlinks(XSSFSheet.java:250)
      at org.apache.poi.xssf.usermodel.XSSFSheet.read(XSSFSheet.java:203)
      at org.apache.poi.xssf.usermodel.XSSFSheet.onDocumentRead(XSSFSheet.java:175)
      at org.apache.poi.xssf.usermodel.XSSFWorkbook.onDocumentRead(XSSFWorkbook.java:260)
      at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:159)
      at org.apache.poi.xssf.usermodel.XSSFWorkbook.&lt;init&gt;(XSSFWorkbook.java:174)
      at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:67)
  </code></pre>
  
  <p>It's interesting that if I open file in LibreOffice (no MS Office on my machine) and re-save it (keeping the format) then document is read fine. As I understand this problem has something to do with validity of document structure - so this is data problem and not error in library code (or isn't it?). But maybe there is a way to suppress such errors?</p>
  
  <p><strong>[UPDATE]</strong> The fix mentioned in comments to accepted answer was integrated in 3.8 version of Apache POI released on March 26th 2012.</p>