Excel 2019 Corrupting Files - I run Windows 10

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.

imnewhere

Posted 2019-08-20T17:54:29.810

Reputation: 11

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 – 2019-08-21T03:40:54.233

I've gotten the following messages: – imnewhere – 2019-08-21T15:31:39.610

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 – 2019-08-21T16:51:25.120

Use the EDIT button and improve your question by adding that necessary information to it. – music2myear – 2019-08-22T03:47:35.217

Answers

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.

Albin

Posted 2019-08-20T17:54:29.810

Reputation: 3 983

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 – 2019-08-21T20:21:56.210

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 – 2019-08-21T20:32:43.943

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 – 2019-08-21T21:44:05.423

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 – 2019-08-22T00:55:34.587