error 13 when i modify the sw document

hi!
when i change manually the sw assembly like change mates values andthen run the macro i have error 13 because vchildcomp=nothing.
vChildComp = swcomp.GetChildren
For j = 0 To UBound(vChildComp)'error 13

but if i run again the macro works well. why?

thanks!SolidworksApi macros