Your logic is wrong. You should be opening excel only once and then writing to the cells whenever you want and once you are don close the excel sheet. You are working with an external application and the biggest overhead is opening the application and then the opening the sheet.
As you said earlier we prepared some generic function
for the opening of the excel and
one function for the reporting purposes and
last for the closing of the excel.The problem i am facing is when ever my scripts
fails at the middle the object of the excel which i created is not killed and and i am getting an error while executing it again that my excel is already open do you want to reopen it......