Corrupted Microsoft Excel Macro-Enabled Workbook xlsm file

84 ビュー (過去 30 日間)
daniel couto
daniel couto 2015 年 5 月 11 日
コメント済み: Marc 2020 年 2 月 26 日
Hello
I have a corrupted Microsoft Excel Macro-Enabled Workbook xlsm file. Does anyone know how i can restore or recover it please?
  1 件のコメント
Walter Roberson
Walter Roberson 2015 年 9 月 20 日
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.

サインインしてコメントする。

採用された回答

Thomas Koelen
Thomas Koelen 2015 年 5 月 11 日
編集済み: Thomas Koelen 2015 年 5 月 11 日
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 件のコメント
Mohamed Sobih
Mohamed Sobih 2016 年 7 月 16 日
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 2020 年 2 月 26 日
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.

サインインしてコメントする。

その他の回答 (2 件)

Manrique Vargas
Manrique Vargas 2017 年 11 月 24 日
Thank you, Thomas, you are a savior.

Project Coordinator
Project Coordinator 2019 年 4 月 22 日
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"

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by