can you check both part and drawing whilst they are open in soldiworks

Hi

I trying to write a VBA macro to do some EPDM tasks, is it possible to check-in and change state for both a drawing and the part (which is in the drawing) whilst having both files open in Solidworks.  I keep getting the "An attempt was made to access a file that is exclusively opened by another application" error and i think it might be due to me having them open?

Thanks

ben

SolidworksApi macros