I had an Excel file with several data which I imported into QGIS as a layer. For some reasons I had to change the data type of one column so I created a new one and imported data from the first column to the new one in the right data type.

That worked well but now I can't open my original Excel file any more. I tried to repair it with the Excel-repairing-tool but that didn't work.

Any help?

  • 2
    besides shaking my head that you seem not to have a backup, did you try opening it with OpenOffice/LibreOffice? Sometimes this already worked for me "repairing" strangly behaving Office documents. – Bernd V. Dec 30 '14 at 16:04
  • 2
    from your question it's not clear how QGIS is responsible for your dilemma, as the title suggests – tomfumb Dec 30 '14 at 16:41
  • Thanks Bernd, I will download OpenOfiice and check this out. The problem ist that from the moment I added an extra coloumn the excel file didn't work anymore. I dont see any other possibility which causes this problem beacause, as I wrote, I was working on that file for some weeks and it went well all the time. – Fabian Dec 30 '14 at 17:32
  • What format did you save it as? – Ian Turton Dec 30 '14 at 18:59
  • 3
    Qgis can't write to excel files even CSV files are read only so it's not going to vr qgis that is doing anything to your file – Nathan W Dec 30 '14 at 20:56

Depending on the size of your original data file, the answer might be to create a new excel file from an original data or data source.

Failing that, reconstruct a new excel file from the data within the QGIS layers attributes -- that is, so much as is available within QGIS to go back to excel

Failing that (and this is where I suspect you would end up...)...

[MAKE COPIES of ANY FILES you are playing with, store the copies in a separate folder and EDIT ONLY THOSE COPIES in that separate folder !!!]

Append the extension ".zip" to your crashed xls file -- later, you will go exploring inside the zip file. You'll discover a bizarre collection of folders and files, but they will contain, among them, your data in XML format (on assumption your original data is stored in a recent excel format, to begin with...)

Create, as part of that exploration, a new excel file, with the data headings you expect in your original excel file, but with one line of fake data. Do NOT amend or change the default formatting in this file. On the assumption that your original, crashed file used one sheet, delete the second and third default sheets in this new file. Then, after saving the file, rename it with the zip extension, and go exploring, there, to see how your data is laid out in the XML format of that one-data XLS file. Because you did not add any formatting, you will be looking at a minimalist version of the file behind the XLS/Zip. This will help, in the next steps.

Then, go back to your crashed file, with its added ".zip" extension, and look for your data. Cut and paste what you can, back into your one-line data file, taking care to be aware of proper XML formatting. You might have corrupted data or files, or characters, or maybe missing some XML, or other problems in your crashed XML file.

For the exploration of the XML files you find, use "Notepad++", as it will highlight the XML formatting, making your discovery process easier.

All this, because I take it your data is very valuable, worth the time to recover, and you're willing to go on this experiment trail.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.