[#30549] [ANN] Ruby 1.8.6 has been released — "Akinori MUSHA" <knu@...>

 Ruby 1.8.6 をリリースしました。

14 messages 2007/03/12

[#30553] help: lib/shell for ruby 1.9 — keiju@... (Keiju ISHITSUKA)

けいじゅ@いしつかです.

13 messages 2007/03/13
[#30585] Re: help: lib/shell for ruby 1.9 — Yukihiro Matsumoto <matz@...> 2007/03/15

まつもと ゆきひろです

[#30587] Re: help: lib/shell for ruby 1.9 — keiju@... (石塚圭樹) 2007/03/15

けいじゅ@いしつかです.

[#30588] Re: help: lib/shell for ruby 1.9 — Yukihiro Matsumoto <matz@...> 2007/03/15

まつもと ゆきひろです

[ruby-dev:30676] excel is not closed in runtime using excel.Quit()

From: "Md. Ruhul Amin" <amin@...>
Date: 2007-03-28 09:31:27 UTC
List: ruby-dev #30676
hi guys,
      I want to read some data from each of the files from a directory
and save it to database.In the time of read operation each excel file is
open but not close after read from the file. After processing of all
files the excel is closed.
here is the code..
code

count=100
i=0
while i<count
i=i+1
begin
excel = WIN32OLE::new('excel.Application')   # create winole Object
    workbook = excel.Workbooks.Open("#{path}") # Open the Excel file
    worksheet = workbook.Worksheets(1) #get hold of the first worksheet
    worksheet.Select      # select the worksheet
    title = worksheet.Range('h3')['Value']  #get value of title
    excel.ActiveWorkbook.Close(0)    # close the workbook
    excel.Quit()       #  close Excel file
   rescue
     excel.Quit()
   ensure
     excel.Quit() unless excel.nil?
   end
end

code end

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.

Please review the code where I made mistake.

please help me.

In This Thread

Prev Next