Hi Nimish,
Another two quick ideas to consider:
a)
> Set objExcel = CreateObject("Excel.Application")
(Depending on the OS?) This line will create a new instance of Excel but not to connect to the already running Excel instance if any. However, Excel is a single-instance application and it is not a good idea to create more than one instance of it. If you need to connect to the already running instance of Excel, you may use the approach described here: https://smartbear-cc.force.com/portal/KbArticleViewer?name=Get-COM-reference-for-a-running-Excel-instance&sp=testcomplete
b)
> objExcel.Application.Quit
It may take Excel some time to close. Does it help if you wait for some time to let Excel quit before setting the reference to it to Nothing? (BTW, somewhere in time it was an article that discussed the necessity of setting object variables to Nothing in VBScript.)
Something like this:
Call objExcel.Application.Quit()
Call objExcel.WaitProperty("Exists", False, 60000)
If (objExcel.Exists) Then
Call objExcel.SaveDumpToLog()
Call objExcel.Terminate()
End If
Set objExcel = Nothing