Using ole_free for Excel on W2K (Ruby 1.8.0-10)


(Moran, Craig M (BAH)) #1

Thank you! excel.Quit works instead of excel.Application.Quit. Silly
mistake on my behalf. I don’t know the difference between the two methods
either.

···

-----Original Message-----
From: Osuka Adartse
Sent: Tuesday, February 10, 2004 2:32 PM
To: ruby-talk@ruby-lang.org
Subject: Re: Using ole_free for Excel on W2K (Ruby 1.8.0-10)

Moran, Craig M (BAH) wrote:

This is my first post. My apologies if I do something wrong. I am using
shk!!
#/usr/bin/env ruby

Title: TestAPP.rb

require 'win32ole’
def onCmdTest(sender, sel, ptr)
excel = WIN32OLE.new(“excel.application”)
excel[‘Visible’] = TRUE
excel.Quit
excel.ole_free
TestExcel()
end
def TestExcel()
excel = WIN32OLE.new(“excel.application”)
excel[‘Visible’] = TRUE
excel.Application.Quit
why the diff here? if excel.quit then it doesn’t lets excel wasting mem
’til closing the gui
excel.ole_free
end

end TestAPP.rb

I just test it, if excel.Application.quit --> excel.quit then your
problem doesn’t appear, but I don’t really know what’s the difference
between those methods