there is something wrong with a macro,please help me!

my macro has something wrong. when the macro runs, it will stop by the sentence"Set swDocMgr = swClassFact.GetApplication("")", and tell me "ActiveX component can not create object" , I do not know how to do? please help me! i have attach the macro and a part to this posts. any idea is welcome, thank you in advance!

                                                                                                                                                             wen yi

SolidworksApi macros