So I found out that if I clicked on Solidworks repeatedly while the macro ran, it worked. Anything I can do about that?
I would suggest you use,
Set Part = swApp.OpenDoc6(OpenName, 1, 0, "", fileerror, filewarning) 'Open saved configuration file
Set Part = swApp.ActiveDoc
else try adding some delay before Set Part = swApp.ActiveDoc if you want to go with that.... the file is not completely loaded in solidworks before this line of code is called and hence Part is set to nothing which is leading to the error.