Hi Seetal,
The bad news is that VBScript does not support runtime exceptions handling and thus you cannot implement something like 'finally' code block that is guaranteed to be executed.
In my opinion, you have only two options available (not counting the third obvious one when you check and close Excel manually):
a) Execute the On Error Resume Next command before opening connection to Excel and check for (If 0 <> Err.Number) error condition after *any* code line that makes use of the opened connection. After closing the connection execute the On Error GoTo 0 command to restore normal error handling in VBScript;
b) Check if the Excel is already running before opening the connection and terminate it (Excel) if it is running. The drawback of this solution is that you might lose unsaved data in Excel.