Cannot dispose an object!!?!?!?!
I'm using a 3rd party API (in this case Quality Center OTA incase its of interest) in an Excel VBA project, and creating an object from it (TDAPIOLELib.tdconnection, which is a class, retuning an object in the documentation).
I use a "If not (thisObject is nothing) Then" statement, before running some cleanup code. At this point, the code inside of this IF statement is correctly executed & "thisObject" is not nothing.
The end of this IF block, I try to use "Set thisObject = nothing" (at this point, in a watch window I can see a whole bunch of "not connected"-type statements against each of the object's properties, however the object still very much exists (I've tried a "?Connection is nothing" call in the immediate window and successfully got a "False" value returned).
As soon as this line is executed, I get a runtime error 438, object doesn't support this property or method! Little confused here and the last thing I want is to have any memory leaks or non-disposed objects floating around having been caused by my macro/code. Help please/any suggestions/explainations?
Re: Cannot dispose an object!!?!?!?!
how are you creating the object?
you will probably need to post your code
[Fixed] Cannot dispose an object!!?!?!?!
What a silly mistake! Thanks westconn1, pointed me in the right direction there. Just found the Connection "object" I was trying to set to nothing was a property get only, & that the actual object, a class-level variable was the one I was after (m_Connection instead).
Thanks for the tip!