Excel báo lỗi try saving to a different file năm 2024

Well known and really anoying bug. It seems to generate when using the VBA editor and deleting some worksheet that is referenced by some formula.

I have resolved (most of the times) by completely removing the vba project using this procedure:

  1. Create a backup copy of the file (from file explorer)
  2. Change file extension from .xlsm to .zip
  3. Open the .zip file and locate the file /xl/vbaProject.bin
  4. Remove this file
  5. Change the file extension back to .xlsm
  6. Open normally the modified file. It should not show the error and save without problems

Obviously in this way you will loose all the VBA macros in the Workbook, so you have to re-import them from the last (hopefully) working version of your file.

  • 2023-03-01T09:50:07.6533333+00:00 Thanks a lot! Really helped, was struggling for few hours.
  • 2023-03-08T16:42:45.99+00:00 Thank you. I lost a few minor macros. But that was nothing to re-create in the face of having to remake the entire workbook.
  • 2023-05-26T16:20:03.39+00:00 This post just solved months of frustration and stress! Much thanks.
  • 2023-05-31T10:56:14.25+00:00 Thank you so much Federico! Your method saved weeks of work on a file! Indeed it looks like the VB code implemented inside got corrupted and after removing it, the file started working again!
  • 2023-06-04T08:00:10.5+00:00 Thank you very much FEDERICO. The solution you proposed worked perfectly. You saved me many hours of work. Thank you again
  • 2023-07-03T08:33:34.0166667+00:00 Thanks so much for your solution , this is amazing method to solve this issue i have same problem and this solution solved it thanks again
  • 2023-07-04T16:02:46.24+00:00 Thank you so much for this! I was going crazy as thiis is occurring in important work files worst part is trying to go back to previous versions didn't remove error.
  • 2023-07-26T06:46:39.88+00:00 Worked perfectly!! Thank you!!
  • 2023-09-18T20:45:33.98+00:00 Hi Federico That worked fine for me - thanks for that! Regards Philip
  • 2023-09-21T17:19:19.8166667+00:00 Worked, thank you!!
  • 2023-10-01T06:44:54.2866667+00:00 perfect
  • 2023-10-11T02:02:59.2933333+00:00 the best thanks
  • 2023-11-11T18:09:06.0266667+00:00 Cannot thank you enough. Last month, I worked 2 weeks on a project.. 60+ pages of visual data pulled from multiple sources.. lost it due to this error. Rebuilt the whole thing from scratch. This morning, it happened AGAIN! I was like, I will quit before rebuilding it again.. Searched for this topic. Found it. Found your response. THANK YOU. THANK YOU. You are a saint.
  • 2023-11-30T06:20:39.0966667+00:00 This answer was posted over 2 years ago, and today it saved me. Worked like a charm! Thanks!!
  • 2024-01-17T04:32:37.2333333+00:00 Hi All! I have run into the many forms of this problem over the years and created this GitHub repository to hold VBA code you may find helpful in recovering from and more importantly, avoiding it altogether. Good Luck Everyone! Hopefully Microsoft will catch a clue on this but I'm personally not hopeful.
  • 2024-01-25T16:07:58.94+00:00 Thanks for the tip Fede, it worked!
  • 2024-02-18T07:44:29.87+00:00 Some heroes don't wear capes. Thank you FEDERICO GALLERANI.
  • 2024-02-18T17:07:54.6733333+00:00 Once again, for those who missed it, a much simpler solution that works for me 100% of the time, AND YOU DON'T LOSE YOUR MACROS LIKE YOU DO USING FG's solution. Fixing .xlsb/.xlsm Macro Files When Macros Stop Working-RESOLVED!
  • Copy corrupted file to subfolder that is not a “Trusted Location”.
  • Open file in Excel, without Enabling Content.
  • Open VBA Editor, click into any line in the ThisWorkbook module, and then save the file from the VBA Editor, and then close the file.
  • Copy the file back to where it was.
  • Open file again to see if everything is now working.
  • 2024-02-19T19:17:57.38+00:00 I originally used the method described by Federico and it worked as advertised, but of course I lost my macros. I then followed the steps detailed by Steve Lipsman and it also worked, and my macros were maintained. I'd suggest following Steve's steps, and if they don't work for some reason then use Federico's steps as a fallback. Make a backup of the original, corrupted file first.
  • 2024-03-27T13:02:12.3233333+00:00 you made my Day!!! This is exactly what i am looking for. It works perfectly with me!!! Thank you so much.

2024-04-09T10:18:01.1466667+00:00

Hi @FEDERICO GALLERANI , after successfully saving the changes to the file. Every time we launch the file, a new error message appears stating, "This won't work because there are more cells in a table on your worksheet." Then, when we click "OK," another error emerges: "The following data range failed to refresh: ExterneGegevens1." Despite attempting to refresh all and saving, upon reopening the file, the same error persists.