Ending a connection with SAP Instance and stop scripting

This can be resolved by ensuring that you destroy all reference to public objects at the end of your script.

In Excel VBA, you can use the following to do this −

Set session = Nothing

In C#, you should be using below −

obj = Null;