From: Shashank Date Date: 2004-04-17T23:04:09+09:00 Subject: Re: Sort Excel spreadsheet with Ruby? "Moran, Craig M (BAH)" wrote in message > Has anyone successfully used Ruby to sort an Excel spreadsheet? One ugly work around would be to define a Macro (say SortMacro) in the spread-sheet which does the sort as required and then do: #--------------------------------------------------------------------------- - require 'win32ole' excel = WIN32OLE.new("excel.application") excel['Visible'] = TRUE spreadsheet = excel.Workbooks.Open("C:\\Path\\to\\your\\spreadsheet\\Spreadsheet.xls") sheet = spreadsheet.Worksheets(1) sheet.Cells.Select excel.Application.Run "SortMacro" #--------------------------------------------------------------------------- - This will work. You can even define a macro on the fly if required. See http://support.microsoft.com/default.aspx?scid=kb;EN-US;194611 HTH, -- shanko