JMichael
JMichael

Reputation: 564

VBA to Repair Corrupt Excel workbook

I am looking for a way to automate opening & repairing Excel workbooks via VBA. A process that is run by another department creates a file daily that my team needs to ingest in order to identify particular events which then drive the output in a report we produce.

Recently the process that other department uses to produce the daily file has been generating them with corruption. Nothing too bad as the clicking "Repair" in the prompt when you manually open fixes any human noticeable issues.

That being the case, I'm hoping to automate that repair step in order to allow our automated process to be used again (rather than doing the whole process manually as we're currently forced to).

I've looked around, and the only answer I've found is Is it possible to automatically repair workbooks?, but the Jet OLEDB doesn't appear to be something we've got. I've tried recording while using "Open & Repair" from the open prompt. That didn't result in anything different than just a regular open.

Option 2 here would be a possibility, but it's more than a bit crude/brute force. It's also not going to be the most performant given the size of the files I'm working with (~110 columns by >10k rows on average).

Any additional ideas would be greatly appreciated.

Upvotes: 0

Views: 52

Answers (0)

Related Questions