Checkin to PDMWorks Vault using API error (24)

Hello,

Thanks you for reading, I am working on a macro, but everytime I tried to checkin, the api would state that "there is no valid client license on this machine. (24)". I do have PDM Workgroup client addin and is able to check in documents manually, it is just that when I tried to use the API, I get this error. Any one ran accross this before? Thanks.

SolidworksApi macros