Chris Hulan
12/5/2006 8:27:00 PM
Bernard Kenik wrote:
> Hi all,
>
> I want to print all the methods in excel OLE object
> in alphabetic order but the sort method is
> unavailable. Can anyone explain it and help me fix it?
>
> Thank you,
>
> Li
> ##
> require 'win32ole'
> excel = WIN32OLE.new('Excel.Application')
> m = excel.ole_methods
> p m.class
> p m.sort
....
Since you want to sort by method name, give a block to sort, i.e.:
p m.sort{|a| a.name <=> b.name}
Cheers
Chris