check for referenced parts

Hi

I have many (thousands) files that needs to be updated.

I have created a macro that can run thru them and do what needs to be done.

The only problem I can't solve is this:

Few of the files (hundreds out of the thousands to be updated) are referenced to other parts, and since I don't have the original parts, I get the pop-up window that asks me to find the location of the referenced part. this makes my macro to wait until I "skip" and it is annoying.

Is there any way to either prevent the pop-up windowfrom popping-up, or to add some code to skip this file if it has a referenced file in it? Like, is there any way to check the file for references BEFORE I use the opendoc command? Because this is the point where it gets stuck

SolidworksApi macros