I got a macro that compiles multiple sheets into one single sheet. However some of the files have the "We found a problem with some content.." issue and as a result, these files are not added by the macro into the compiled sheet.

Is there a way to incorporate code into the macro to ignore/fix the error?

At the moment I manually go through each of the files with errors, click yes and then click the successfully repaired dialog box ok. I then save it and overwrite the old file. This then gets rid of the errors and I am able to successfully compile the files together.