Solved

How to recover data in spread sheet from xlsm file damaged by coding error

Posted on 2014-12-15
2
388 Views
Last Modified: 2014-12-16
I made a coding error in changing a contant (string) to a simple public variable and corrupted my file.
The current version of data in one spread sheet is not backed up, and I seek to recover it
All developer code Is backed up

When I attempted to open the xlsm file, the Excel announcement screen opened, and reported the correct name of the file it was opening. After a long delay, it reported that it was "Opening and repairing" the file as "Attempt#1".
After 15 minutes, no progress had been achieved.

For example, can I recover this spreadsheet data, say by converting the xlsm file to xlsx (without opening it)?

Thanks!
Kelvin4
0
Comment
Question by:Kelvin4
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
Kimputer earned 500 total points
ID: 40502101
If you are really sure the code is responsible, you can easily fix it.
Make backup of the original file (even though it's corrupt)
Rename xlsm to zip, open zip file as usual (though I'd prefer you to use 7zip), navigate to the folder xl, delete the file vbaProject.bin
Rename back, open file. If the corruption was  really only inside the code, it should start normally (without any working code, it will be empty), and all sheet data should be there.
If still error, the error must have sneaked into the sheet data. Then use the zip method again, remove sheet1.xml from the folder xl\worksheets, test file (acknowledge warnings, try to fix it). If it starts now, you will only be missing sheet1. If still doesn't start, copy file from backup, start over, delete sheet2, repeat till all sheets are tried.
If still nothing, start over again, now delete the theme1.xml from the xl\theme folder (obviously you will lose a lot of your layout/fonts etc). Then if still error, try removing styles.xml.
After that, I'm out of ideas.
0
 

Author Closing Comment

by:Kelvin4
ID: 40502136
Thanks for speedy help to worried questioner!

Actually in the short interval, i opened a blank xl file and in Options, set the recalculate option to Manual (selection '4' as it happened).

Then uploaded offending xlsm file. It opened, and reported an ambiguous Constant .
By closing the reporter window using the top right red 'close X' interaction, the offending code remained visible and editable.

Thus the error was commented out, and the file seems to be alive and well with the rest of the code.

But, again thanks for your method which is more 'hands on' and flexible.
Kelvin

Kelvin
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question