Automation object instances are created with set, manipulated with automation function calls and then terminated. Terminating the automation class ensures that resources are freed from memory.
The following code should be used when the automation object is no longer used, effectively closing the automation server: