My Oracle Support Banner

SQL*Plus SPOOL File Output with .XLSX Extension Fails to Open in Excel (Doc ID 2423612.1)

Last updated on JULY 16, 2018

Applies to:

SQL*Plus - Version 11.1.0.6 and later
Information in this document applies to any platform.

Symptoms

Use SQL*Plus SPOOL command to generate an .xlsx output file.  When attempt to open this output file in MS Excel, it fails with the following error message:

Excel cannot open the file 'spooled_output.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.
  [OK]



STEPS:           

The issue can be reproduced at will when execute the following sample script in SQL*Plus:

Then attempt to open /tmp/spooled_output.xlsx in MS Excel.
It will fail with the reported error above.

Changes

Generating .xlsx output files.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.