Corrupted Microsoft Excel Macro-Enabled Workbook xlsm file

70 visualizaciones (últimos 30 días)
daniel couto
daniel couto el 11 de Mayo de 2015
Comentada: Marc el 26 de Feb. de 2020
Hello
I have a corrupted Microsoft Excel Macro-Enabled Workbook xlsm file. Does anyone know how i can restore or recover it please?
  1 comentario
Walter Roberson
Walter Roberson el 20 de Sept. de 2015
This question was posted by a spammer as the lead-in for a spam response. I have not deleted it, however, because Thomas's response is legitimate and helpful.

Iniciar sesión para comentar.

Respuesta aceptada

Thomas Koelen
Thomas Koelen el 11 de Mayo de 2015
Editada: Thomas Koelen el 11 de Mayo de 2015
The answer depends, in large part, on how corrupted the workbook really is and where the corruption is located within the workbook. Much has been written about how to recover corrupted workbooks; the following resources will be of interest in this regard:
http://support.microsoft.com/kb/820741 (for Excel 2002 and 2003)
for 2010:
Open Excel 2010.
Click on File > Options.
Select Trust Center > Trust center settings.
Select Protected view.
Uncheck all the options under Protected View > OK. Restart Excel 2010 and try to open Excel documents.
Most of these pages refer specifically to recovering data, not to recovering the macros in a module associated with a workbook. (It is interesting that the Microsoft Knowledge Base doesn't have any articles on recovering data from a corrupted Excel 2007 workbook. Perhaps one will come, with time.) One thing that you might try in order to get your macros is the following:
Open Excel, but not the problem workbook.
Set the calculation mode to manual (Tools | Options | Calculation tab | Manual).
Set the security setting to High (Tools | Macro | Security | High).
Open the troublesome workbook. If it opens successfully, you should see a notice that the macros were disabled. (If the workbook doesn't open, then you might as well shut Excel down; this series of steps won't work.)
Press Alt+F11 to display the VBA Editor.
In the Project Explorer, locate the module you want to save.
Right-click the module name and choose Export File.
Provide a name and location of where to save the module.
Close the VBA Editor and get out of Excel.
With the module saved in its own file, you can now import it into another workbook, as desired.
Another way to attempt recovery is to use OpenOffice, a free alternative to Microsoft Office. The spreadsheet program in OpenOffice will open Excel files, and it isn't as sensitive to some corruption issues.
If this still doesn't work, try using a low-level file manipulation tool that allow you to read files sector by sector from a disk, and then allow you to see the information in each sector. With most types of files this won't be very helpful. In fact, it wouldn't help you recover any data from an Excel workbook. Recovering macros is a different story, however. They are stored in the workbook in plain ASCII text, so you should be able to recognize the macro code and then copy it from the disk tool.
  2 comentarios
Mohamed Sobih
Mohamed Sobih el 16 de Jul. de 2016
Hi Thomas, You saved me from very long coding hours. Actually I created my account here just to thank you :) I'm very grateful, Thanks a million :)
Marc
Marc el 26 de Feb. de 2020
Hi Thomas. Like Mohamed, I created an account just to thank you. I couldn't open an Oracle EBS upload macro file and following your steps saved me a lot of rework. Just wanted to thank you.

Iniciar sesión para comentar.

Más respuestas (2)

Manrique Vargas
Manrique Vargas el 24 de Nov. de 2017
Thank you, Thomas, you are a savior.

Project Coordinator
Project Coordinator el 22 de Abr. de 2019
Like Mohammed above I created an account here just to say thanks!
I also wanted to let people know this fix works for MS Excel 2016 as well.
I also was a little desperate after recent Microsoft updates. My .xslm file would NOT open and just kept shutting down.
After applying the fix above I realized that Microsoft in its wisdom has decided to reset all MSOffice programs back to default settings when they did the most recent update "Windows 10, version 1809 amd64 2019-04"
Capture.JPG
What you need to do is check all of the settings as shown above.
Open your file in a Macro disabled environment. Save it
Then start to build up the settings again to where your macros are enabled.
Good luck to anyone who has been struck by this latest Microsoft created "bug"

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by