LibreOffice 6.4 is trying to open an ods file in writer.

This ods file was created 2 years ago and worked perfectly until this morning. It was last saved yesterday.

This morning when it tried to open it in writer, it opens to 48 pages of #. Other ods files in the same directory work fine.

Any idea how to get it open correctly.

Not sure what other details you need.

Thanks in advance

LibreOffice doesn’t choose the model to be used for loading a file based on the file extension, but based on the mime type stored in the file itself. If nothing is stored there, plain text may be supposed, and Writer will be used

Only the OS (Windows in specific) associates applications with the file extensions, and LibreOffice may try to open a plain-text file with Calc if the extension is .csv.

The .ods is the default extension for zipped spreadsheet files. It can be changed to whatever you choose without changing the mime type describing the actual content.

If a file opens to a display of thousands of “#” it is corrupted beyond repair anyway.

If there should be hope to recover the document, you need to find a backup, or a probably “deleted” but not yet overwritten (on the storage medium) version by means directly accessing the file systen (“Recuva” or the like.)
As long as you are on pursuit for recovery, use your storage mediums as little as possible. Every action may overwrite something needed for successful recovery.

BTW: Most likely LibreOffice is not the culprit. Common causes for file corruption of the kind are system breakdowns, forced shutdown during save operations, removal of media like “thumb-drive”, hardware failures, general system corruption. …

You may find examples and suggestions starting here: Search • Apache OpenOffice Community Forum. (This older forum has a lot of help and you can actually find it again in many cases.)

Thanks for the advice. I have restored it from a backup.