title: openpyxl cannot read Strict Open XML Spreadsheet format: UserWarning: File contains an invalid specification for Sheet1. This will be removed
body: <p>A few of my users (all of whom use Mac) have uploaded an Excel into my application, which then rejected it because the file appeared to be empty. After some debugging, I've determined that the file was saved in Strict Open XML Spreedsheet format, and that openpyxl (2.6.0) doesn't issue an error, but rather prints a warning to stderr.</p>
  <p>To reproduce, open a file, add a few rows and save as Strict Open XML Spreedsheet (*.xlsx) format.</p>
  <pre><code>import openpyxl
  with open('excel_open_strict.xlsx', 'rb') as f:
      workbook = openpyxl.load_workbook(filename=f)
  </code></pre>
  <p>This will print the following warning, but will not throw any exception:</p>
  <pre><code>UserWarning: File contains an invalid specification for Sheet1. This will be removed
  </code></pre>
  <p>Furthermore, the workbook appears to have no sheets:</p>
  <pre><code>assert workbook.get_sheet_names() == []
  </code></pre>
  <p>I've now had three Mac users experience this issue. It seems like Mac will sometimes default to using this Strict Open XML Spreedsheet format. If this is a normal case, then openpyxl should be able to handle it. Otherwise, it would be great if openpyxl would just throw an exception. As a workaround, it seems I can do the following:</p>
  <pre><code>import openpyxl
  with open('excel_open_strict.xlsx', 'rb') as f:
      workbook = openpyxl.load_workbook(filename=f)
  
  if not workbook.get_sheet_names():
      raise Exception(&quot;The Excel was saved in an incorrect format&quot;)
  </code></pre>