how to make a document active?

Hi to all,

I have a stupid qustion guys :)) I was using updated xyz exporter script of sir Stephen Todd:

https://community.accelrys.com/thread/1752

I came up with an error:

No choice of active document has been made (function/property "ActiveDocument") at -e line 24.

so how to make a document active?

Thanks in advance,

KaSep.