GTOL numbering

Hello all,

I would like to create a macro to number all GT frames in the view. I have no problem to do the same with dimensions. What is wrong with this DO-LOOP that I get run-time error 438?

Do While Not swDispGtol Is Nothing

     i = i + 1

     swDispGtol.SetText swGTolTextCalloutAbove, i

     Set swDispGtol = swView.GetNextGTOL()

Loop

Thanks,

Alen

SolidworksApi macros