From: Bernard Kenik Date: 2007-07-09T12:18:55+09:00 Subject: Re: win32ole: application.quit() leave process running Todd Burch wrote: > Yes, after more searching, I found a few threads here that deal with > this same issue. It appears that this is a problem. > > I am going to "work around this" with the following code: > > xlapp.activeworkbook.close() ; > xlapp.ole_free ; > xlapp = nil ; > GC.start ; > > This causes my workbook to close, leaving an "empty" excel session. > When I subsequently manually close (red x) the excel session, it > terminates completely and can no longer be seen in Task Manager. > > Ugly, butI would rather do this than leave multiple EXCEL.EXE processes > running. If I leave the xlapp.quit in there, there is no visible > instance of excel to close, and I have to go into Task Manager and end > the process. Which, in my opinion, is uglier. > > Thanks, Todd Use appl.Quit not appl.quit make sure your workbooks are closed prior to quitting. I use this code snippet to open the excel application begin excel = WIN32OLE.connect("excel.application") rescue excel = WIN32OLE.new("excel.application") end Thus I connect to a running Excel instance or start a new instance. -- Posted via http://www.ruby-forum.com/.