VBA runtime error when using PDM checkIn function

So im trying to write a makro to automate the name generation and the check in to the pdm Vault. The makro works fine to the point where the checkIn function is used.

I get the runtime error´-2147220968 (80040218)

There is no valid client license on this machine

The manual check in works fine and i can delete files from the fault via API.

SolidworksApi macros