Have you added the reference to swconst.tlb which is the type SOLIDWORKS constant type library.
If not please add it to the references. in VBA editor >> Tools >> References >> SOLIDWORKS <version> constant type library
Thanks for your help. Now it works. I switched the all 2013 library to 2015 ones.