Checkin Active Document in PDM by API

Hello Everyone,

I am not able to checkin the active document in WorkgroupPDM by API .Any Closed document can be checked in easily.How to checkin active Document

Thanks

SolidworksApi macros