05-11-2020 06:43 PM
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?
05-11-2020 09:47 PM
Post your code and the file, it's nearly impossible to help without both of those.
05-11-2020 10:02 PM
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.
05-12-2020 06:40 AM - edited 05-12-2020 06:43 AM
@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.
05-12-2020 11:29 AM
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).
05-13-2020 02:16 AM
@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).
05-13-2020 11:24 AM
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").