My Oracle Support Banner

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

Last updated on FEBRUARY 11, 2022

Applies to:

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


Use SQL*Plus SPOOL command to generate an .xlsx output file.  When attempting 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.


The issue can be reproduced at will when executing 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.


Generating .xlsx output files.


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

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

In this Document

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