I just want to share a tip with all of you, b/c it burnt me and wasted a few hours of my time.
I was using a third party, ActiveX EXE and every so often, it was cause a huge memory leak. I checked all my references, made sure they were being destroyed, as well as making sure no circular ref's were present. Here is the scenario that got me:
Hence, my routine in actuallity was much larger than this small sample. Well, b/c I raised an error within the with block, the object's reference count is incremented, thus will not release from memory when set to nothing.Code:On Error Goto ErrorHandler Dim objExtra As New Extra.Session With objExtra ' do some calculation and login routines.... If objExtra.Value <> 0 Then Err.Raise vbObjectError + 7000 End If End With Set objExtra = Nothing Exit Sub ErrorHandler: objExtra = Nothing Err.Raise Err.Number
Just something to watch out for....
![]()




Reply With Quote