destory object

rishi_375

Registered User.
Local time
Today, 18:20
Joined
Dec 23, 2003
Messages
37
Hi,
I try below code for destory object like excel application object, workbook, work sheet and adodb.

Public Sub gSetNothing(ParamArray objName() As Variant)
Dim i As Integer

For i = LBound(objName) To UBound(objName)
If IsObject(objName(i)) = True Then
If objName(i) Is Nothing = False Then
Set objName(i) = Nothing
End If
End If
Next

End Sub

it set object as nothing but object is not destory.
Please give me suggestion.
Thanks.
 

Users who are viewing this thread

Back
Top Bottom