Excel “Errors were detected while saving (filename). FIXED!

I ran across an issue where a user could not save an excel document that contained VBA projects and links to other data sources.

 

The error message below was presented when the user tries to save the document:

“Errors were detected while saving (filename). Microsoft excel may be able to save the file by removing or repairing some features. To make the repairs in a new file click Continue. To cancel saving the file click Cancel.

When trying to unprotect the sheets and remove the VBA code the user received a DLL error message

Manually removing the VBA project was not possible, so I looked at other solutions. I stumbled across this powershell method that seems to have solved the issue.

https://gallery.technet.microsoft.com/office/How-to-remove-all-VBA-7b81b915