LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel file corrupted

I have an xlsx file of data obtained using Labview 2015 that I am unable to open. The data was collected and the laptop screen froze. Once this was working again the file was saved but when I tried to open it there was a message that the file could not be opened due to file format or extension.  Is there any way I may be able to open this? 

0 Kudos
Message 1 of 7
(2,050 Views)

Post your code and the file, it's nearly impossible to help without both of those.

0 Kudos
Message 2 of 7
(2,006 Views)

I would think this file would be next to impossible (if no entirely impossible) to load because xlsx file is a compressed xml file format, and compressed files are usually impossible to recover once corrupted.  Anyone please correct me if I am wrong.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 7
(2,001 Views)

@billko wrote:

I would think this file would be next to impossible (if no entirely impossible) to load because xlsx file is a compressed xml file format, and compressed files are usually impossible to recover once corrupted.  Anyone please correct me if I am wrong.


In fact, a normal .xlsx file can be renamed to .zip and opened as zip archieve. There's usually more than 1 XML file in it, and sometimes binary files like images.

 

If that doesn't work, the compressed data is corrupt, and the content is simply lost. Although technically, a zip has each file in a separate bin. So with a lot of effort, some files might still be recovered.

 

If it does open, one of the files in the archieve is corrupt. There might be a change some data is reoverable.

 

Often when files are corrupted, they're simply truncated at some point. This happens when the application is quit (Quit LabVIEW) and the files haven't been flushed properly. The file would help to diagnose the problem.

0 Kudos
Message 4 of 7
(1,976 Views)

I'm crossing my fingers someone just saved a .csv as a .xlsx file (which Excel figures out, or at least did a few years ago).

0 Kudos
Message 5 of 7
(1,955 Views)

@BertMcMahan wrote:

I'm crossing my fingers someone just saved a .csv as a .xlsx file (which Excel figures out, or at least did a few years ago).


I've seen that a lot. Nothing wrong with it really.

 

It's weird how difficult it is to interface with Excel and Word in a good way. Not with ActiveX, as that forces a specific version of Excel\Word last time I checked. I had a customer call me up that their executable stopped working. IT updated Office. Can't have that.

 

We've been experimenting with opening the zip and modifying the xml files. Not too difficult to make small changes. But much harder to make a proper API, as there is so much you can do...

 

We're now trying to interface with Excel over a ADO connection. So, accessing it as a database. Seems to work pretty well for reading and writing data. Not sure how inserting stuff would work (but that's not what we need right now).

0 Kudos
Message 6 of 7
(1,934 Views)

I am curious about what You mean by this, exactly:

 


@lvuser20 wrote:

the file could not be opened due to file format or extension


If I were to save some excel file and renamed the extension from ".xlsx" to, say, ".xslx", and then tried to open it in excel, the error message would also look quite similar. Also, in addition to the suggestions above of trying .zip as an extension, you may want to try opening the file in a text editor (e.g., by renaming it to ".txt").

0 Kudos
Message 7 of 7
(1,913 Views)