0

I've upgraded to Excel 2019 and run some fairly basic VBA code on files created in Excel 2010. I'm finding Excel 2019 corrupts my files randomly (I save daily versions of similar files where some data gets scraped from the internet and some is entered by the user). Is anybody else having similar problems? Should I just start from scratch in Excel 2019 and import all the code from the 2010 files?

I receive the following messages: 1st message: "Errors were detected while saving 'C\Users etc...\'. Microsoft Excel may be able to save the file by removing or repairing some features. To make repairs in a new file, click Continue. To cancel saving the file, click Cancel." When clicking Continue repairing doesn't work. Then I get "File not saved" 2nd message: "Can't Find Project or Library" so ALL the macros get deleted.

Thank you all for taking the time to read/respond.

  • How is the data being corrupted? VBA code changes over versions and the changes are well documented my Microsoft including changes needed. Also, unless there's good reason, you should use the latest format you can. So please edit your question to make it more clear and give us the information to better understand your problems. – music2myear Aug 21 at 3:40
  • I've gotten the following messages: – imnewhere Aug 21 at 15:31
  • 1st message: "Errors were detected while saving 'C\Users etc...\'. Microsoft Excel may be able to save the file by removing or repairing some features. To make repairs in a new file, click Continue. To cancel saving the file, click Cancel." When clicking Continue repairing doesn't work. Then I get "File not saved" 2nd message: "Can't Find Project or Library" so ALL the macros get deleted. – imnewhere Aug 21 at 16:51
  • Use the EDIT button and improve your question by adding that necessary information to it. – music2myear Aug 22 at 3:47
0

There is no general information without knowing the code. So, yes, you should start from scratch and review the code. If the code causes the problem it will not make sence to import it again 1:1.

  • My hunch is that the code isn't the problem since the corruption happens randomly (ie. code runs without any glitches most of the time....). Correct me if I'm mistaken. – imnewhere Aug 21 at 20:21
  • feel corrected... "random occurrence" only means the problem is harder to find since it can not be reproduced (yet). It could be a problem with the code behaving differently in Office 2019 (that's a known issue). I think with "fairly basic VBA code" I would start there, since "basic code" isn't very time consuming to check. Even if you find nothing at least you will be able to exclude the code as being the problem. Neither Excel nor Windows corrupts existing files "by nature", but bad code does it quite often, so personally I would suspect the code first. – Albin Aug 21 at 20:32
  • Thank you! I didn't know about code behaving differently in Office 2019. Stepping through the code line by line (F8) - is that the best way to check it? One of the subs opens another workbook & copies/pastes data in it. I've got a feeling the corruptions take place when the destination file gets over a certain size. Have you heard of this issue before? Thanks again – imnewhere Aug 21 at 21:44
  • Stepping through line by line is a good start. In general there can be size issues, yes. But there is no single issue with how code will behave, there are too many possibilities to design code. In the end this might be a better question for stack overflow. – Albin Aug 22 at 0:55

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.