From: Masaki Suketa Date: 2007-03-28T21:06:20+09:00 Subject: [ruby-dev:30677] Re: excel is not closed in runtime using excel.Quit() Hello, In message "[ruby-dev:30676] excel is not closed in runtime using excel.Quit()" on 07/03/28, "Md. Ruhul Amin" writes: > For 50/100 or more files, too many number of excel processes are shown > in the process list of Test manager.The cpu utility becomes 100% and > memory(RAM) becomes full and computer becomes very slow, almost hung. > Could you show me the version of Ruby which you use? It seems to me that it is Win32OLE memory leak bug. And the bug is fixed in Ruby 1.8.6. If you use 1.8.6 or later, then try GC.start after excel.Quit() excel.ActiveWorkbook.Close(0) # close the workbook excel.Quit() # close Excel file excel = nil # <-- add GC.start # <-- add Or, try the creation of Excel object out of while loop scope. You create Excel object only at once, and call excel.quit only at once. excel = WIN32OLE::new('excel.Application') # create excel only at once while i