Insert table API Issue.

Hi,

I try to create table using the SWx sample macro(Attached).

Its working fine for the first run. if I delete the created table and rerun the macro again, its getting a error

May I know what was the issue with these codes?

Thanks

SolidworksApi macros