
Yes. you should add to your code ReleaseObject procedure because close file is not enough.
In VB I use code looks like:
Private Sub ReleaseObject(ByVal obj As Object)
Try
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(obj)
obj = Nothing
Catch ex As Exception
obj = Nothing
Finally
GC.Collect()
GC.WaitForPendingFinalizers()
End Try
End Sub
and you can use it:
ReleaseObject(wks)
wkb.Close(False) ' or True if you save it once with name'
ReleaseObject(wkb)
Regards