Typically this means that you have disposed of the object and then are trying to use it again. Look out for the use of "using" statements. Once a using block is complete, the underlying COM objects are released and you should not use references to the library object any longer.
For example, the code you posted above uses a using statement incorrectly and will result in errors when using the ts variable after the using block.
For example, the code you posted above uses a using statement incorrectly and will result in errors when using the ts variable after the using block.