Author Topic: corrupted excel file  (Read 2716 times)

ElyDave

  • Royal and Ancient Polar Bear Society member 263583
corrupted excel file
« on: 11 July, 2020, 02:15:43 pm »
an excel file on my desktop has become corrupted, will not open with any of the in-built tools, any solutions?

The file was good as of noon today, but corrupt as of 1pm, Excel statins "extention not recognised" or some such nonsense. 

Despite having autosave on, the autorecover directory does not contain any history of this file
“Procrastination is the thief of time, collar him.” –Charles Dickens

Jaded

  • The Codfather
  • Formerly known as Jaded
Re: corrupted excel file
« Reply #1 on: 11 July, 2020, 03:28:02 pm »
XLSX files are XML I believe.

I'd only work on a copy of the file, and I'd open in it a text editor and compare it's structure and internals with a file that does work.

It is simpler than it looks.

Re: corrupted excel file
« Reply #2 on: 11 July, 2020, 03:42:26 pm »
XLSX are zip files containing a bunch of files, most of which are xml.

Code: [Select]
$ unzip -l example.xlsx
Archive:  example.xlsx
  Length      Date    Time    Name
---------  ---------- -----   ----
     1421  01-01-1980 00:00   [Content_Types].xml
      735  01-01-1980 00:00   _rels/.rels
     2027  01-01-1980 00:00   xl/workbook.xml
      831  01-01-1980 00:00   xl/_rels/workbook.xml.rels
    40678  01-01-1980 00:00   xl/worksheets/sheet1.xml
     8390  01-01-1980 00:00   xl/theme/theme1.xml
    13014  01-01-1980 00:00   xl/styles.xml
    10096  01-01-1980 00:00   xl/sharedStrings.xml
     1594  01-01-1980 00:00   xl/calcChain.xml
      762  01-01-1980 00:00   docProps/core.xml
      815  01-01-1980 00:00   docProps/app.xml
     1454  01-01-1980 00:00   docProps/custom.xml
---------                     -------
    81817                     12 files

So I'd start with checking whether the zip file container itself is corrupt.
"Yes please" said Squirrel "biscuits are our favourite things."

ElyDave

  • Royal and Ancient Polar Bear Society member 263583
Re: corrupted excel file
« Reply #3 on: 11 July, 2020, 04:25:25 pm »
and exactly how do I do that?

Small words please, step by step.
“Procrastination is the thief of time, collar him.” –Charles Dickens

Jaded

  • The Codfather
  • Formerly known as Jaded
Re: corrupted excel file
« Reply #4 on: 11 July, 2020, 04:37:35 pm »
See if it will open with a program that deals with zip files. Are you Mac or PC?
It is simpler than it looks.

ElyDave

  • Royal and Ancient Polar Bear Society member 263583
Re: corrupted excel file
« Reply #5 on: 11 July, 2020, 04:38:48 pm »
PC, will try that ,

does it also apply to an xlsm file?
“Procrastination is the thief of time, collar him.” –Charles Dickens

Re: corrupted excel file
« Reply #6 on: 11 July, 2020, 05:26:47 pm »

ElyDave

  • Royal and Ancient Polar Bear Society member 263583
Re: corrupted excel file
« Reply #7 on: 11 July, 2020, 05:59:03 pm »
Excel has an "open and repair" feature, have you tried that?

https://support.microsoft.com/en-us/office/repair-a-corrupted-workbook-153a45f4-6cab-44b1-93ca-801ddcd4ea53

first thing I tried, excel is basically refusing to recognise it as an excel file - file format or extension not valid
“Procrastination is the thief of time, collar him.” –Charles Dickens

fuaran

  • rothair gasta
Re: corrupted excel file
« Reply #8 on: 11 July, 2020, 06:14:29 pm »
Is the file extension correct? By default Windows hides file extensions, so it may not be obvious what the file extension actually is.

Or try opening it in LibreOffice.

Jaded

  • The Codfather
  • Formerly known as Jaded
Re: corrupted excel file
« Reply #9 on: 11 July, 2020, 07:45:46 pm »
There must be a way of seeing the file extension, and changing it to an excel type (on a copy of the file, of course!)
It is simpler than it looks.

Mr Larrington

  • A bit ov a lyv wyr by slof standirds
  • Custard Wallah
    • Mr Larrington's Automatic Diary
Re: corrupted excel file
« Reply #10 on: 11 July, 2020, 08:01:36 pm »
In File Exploder's "View" toolbar there's a checkbox for "File name extensions".  Why anyone would want this turned off is a mystery to this Unit; presumably Microsith would prefer us not to worry our pretty little heads about such arcana in case we break things.  Which is their allotted role.
External Transparent Wall Inspection Operative & Mayor of Mortagne-au-Perche
Satisfying the Bloodlust of the Masses in Peacetime

Kim

  • Timelord
    • Fediverse
Re: corrupted excel file
« Reply #11 on: 11 July, 2020, 08:05:08 pm »
Why anyone would want this turned off is a mystery to this Unit

Makes it easier to create files with names like AAAASheila.doc.DOC or dancingpigs.avi.exe, innit.

Mr Larrington

  • A bit ov a lyv wyr by slof standirds
  • Custard Wallah
    • Mr Larrington's Automatic Diary
Re: corrupted excel file
« Reply #12 on: 11 July, 2020, 08:17:37 pm »
Me: Save this file as foo.bar!
It: (Saves file as foo.bar.txt)
Me: Do not do that.  Now I have to change it, as otherwise the SCIENCE will break.
It: ZOMG!!!!eleven!?!  WHAT R U DOING???  UR CHANGING THE EXTENSION!!!  THAT COULD BREAK THE SCIENCE, CAUSE 1 OR MORE BIBLICAL PLAGUES AND MELT UR WIFI CABLES!!! STOP, BEFORE IT'S 2 LATE!!!1!
Me: Fck. Off.

Command lines may be old-skool but at least they don't complain about that sort of thing.  Once you've mastered the (garbled and inconsistent) syntax, obv.
External Transparent Wall Inspection Operative & Mayor of Mortagne-au-Perche
Satisfying the Bloodlust of the Masses in Peacetime

ElyDave

  • Royal and Ancient Polar Bear Society member 263583
Re: corrupted excel file
« Reply #13 on: 11 July, 2020, 08:25:03 pm »
There must be a way of seeing the file extension, and changing it to an excel type (on a copy of the file, of course!)


In File Exploder's "View" toolbar there's a checkbox for "File name extensions".  Why anyone would want this turned off is a mystery to this Unit; presumably Microsith would prefer us not to worry our pretty little heads about such arcana in case we break things.  Which is their allotted role.

fiel name extension is on, it is an xlsm, so already an excel file, I've never had this issue before. Every other spreadsheet I acess from the hard-drive is in the autosaves folder, except this one!
“Procrastination is the thief of time, collar him.” –Charles Dickens

iddu

  • Are we there yet?
Re: corrupted excel file
« Reply #14 on: 11 July, 2020, 10:09:17 pm »
.xlsm <> .xlsx

CLU in the error "...because the file format or file extension is not valid.  Verify that the file has not been corruted and that the file extension matches the format of the file."
 
If you're sure it's spreadheet content, just change the extension back to .xlsx, so it stops trying to interpret content on wrong guidance
I'd offer you some moral support - but I have questionable morals.

Re: corrupted excel file
« Reply #15 on: 11 July, 2020, 10:14:09 pm »
xlsm is a macro containing xlsx and should be recognised by excel.

My regular problem is an export from one system that comes out as a csv file with an xls extension that excel opens but complains about each time.

iddu

  • Are we there yet?
Re: corrupted excel file
« Reply #16 on: 11 July, 2020, 10:16:34 pm »
See above - assumptions about content are made from what it's called...
I'd offer you some moral support - but I have questionable morals.

tonycollinet

  • No Longer a western province of Númenor
Re: corrupted excel file
« Reply #17 on: 11 July, 2020, 11:26:33 pm »
try opening with an office suite that claims office compatibility - eg open office, or even google docs.

ElyDave

  • Royal and Ancient Polar Bear Society member 263583
Re: corrupted excel file
« Reply #18 on: 12 July, 2020, 07:30:29 am »
Thanks all,
- I know it's a spreadsheet, I created it, its my exercise log
- will try google docs or something

Because its a spreadsheet format I created a few years ago, I can take last years and recreate, with significant pita factor of reentering about 250 lines of workout info. There is other data that will be irrevocably gone, but not so important
“Procrastination is the thief of time, collar him.” –Charles Dickens

ElyDave

  • Royal and Ancient Polar Bear Society member 263583
Re: corrupted excel file
« Reply #19 on: 12 July, 2020, 07:40:27 am »
Google Sheets won't play either, seems completely FUBAR'd
“Procrastination is the thief of time, collar him.” –Charles Dickens

Jaded

  • The Codfather
  • Formerly known as Jaded
Re: corrupted excel file
« Reply #20 on: 12 July, 2020, 08:46:00 am »
If it isn’t confidential, send it to someone else to have a look.
It is simpler than it looks.

ian

Re: corrupted excel file
« Reply #21 on: 13 July, 2020, 09:22:24 am »
Can you not roll back to the version before it went it kaput? It's usually the quickest solutions even if it involves some rework.

In the Macverse, when I've had this, I've opened the xml and found the bulk of the file, which usually hides in the biggest file in the package. And rejoice at the well-structured xml.

And yes, it's a peculiar feature of Excel that the autosave won't have worked when you need it. It's up there with 'this file won't save' error. Oh, erm, thanks.

Jaded

  • The Codfather
  • Formerly known as Jaded
Re: corrupted excel file
« Reply #22 on: 13 July, 2020, 10:07:18 am »
Unfortunately the file has nothing in it, I've tried various methods, including a HEX editor. It is just '0's

So the only recourse, I fear, is to find an old copy, or recreate.   :(
It is simpler than it looks.

ElyDave

  • Royal and Ancient Polar Bear Society member 263583
Re: corrupted excel file
« Reply #23 on: 13 July, 2020, 11:21:43 am »
Thanks for taking a look, I hope MS has found a use for the numbers they have stolen.

The recreation has started, I wasn't hopeful.
“Procrastination is the thief of time, collar him.” –Charles Dickens

Re: corrupted excel file
« Reply #24 on: 13 July, 2020, 12:30:17 pm »
Excel will NOT normally create xlsm files by accident. If you have managed that unaided, I would suspect the presence of some malware, or almost-malware as what you have is clearly an intended consequence.