About thickness analysis

I used

lStatus = iThickAna.RunThickAnalysis2(0.001, 0.010, true, (int)gttckResolutionOptions_e.gttckLowResolution,
                    (int)gtResultOptions_e.gtResultShowUI, "", false, false, false);

in C# to run a thickness analysis tool, but when I use lStatus = iThickAna.Close(); to close it I get the error 12007. Can anyone help me?

SolidworksApi macros