Bernard K. wrote:
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
excel = WIN32OLE.connect("excel.application")
excel = WIN32OLE.new(“excel.application”)
Thus I connect to a running Excel instance or start a new instance.
Why use appl.Quit and not appl.quit? Observations have shown that they
both work just fine, and all of the Excel DOM collections, objects,
properties, methods and enumerations are handled in a case insensitive
manner. Is it to distinguish between possible future additions to the
script my programmers other than myself that might add a #quit method
and/or due to the #missing_method paradign that WIN32OLE uses? Doesn’t
using capital letters for method names go against the ruby syntax rules
for naming conventions? Is it a holdover from VBA? Does your
recommendation apply to the other Excel DOM methods, properties (etc) as
I’ve worked out a workflow that does not involve using quit (see above),
but I am closing my workbooks. Thanks.
Good idea on the “connect”.
And, finally, to learn the methods of a class, like WIN32OLE, I would
typically go interactive (IRB or such) and issue a
WIN32OLE.methods - Object.methods
to get a list of the methods specific to WIN32OLE. I see connect, and a
[“codepage”, “codepage=”, “connect”, “const_load”, “ole_free”,
Where does one get doc on these methods? And, obviously missing here is
#new, but that’s due to my (probably flawed) process of getting method
names, since one can Object.new too.