0 Replies Latest reply on Jun 26, 2006 9:35 AM by tfishb

    Sort Data in Excel using Com object

    tfishb Level 1
      I am trying to sort data in an Excel spreadsheet created from Cold Fusion. I am using the Com object to access Excel and I can add data, etc no problem and save the Excel file. Example of how I access Excel:

      <cfobject action="connect" class="Excel.Application" name="objExcelApp" type="COM">

      I would like to sort a range of cells on the spreadsheet. When I run a macro in Excel I get the following code:

      Range("A29:G48").Select
      Selection.Sort Key1:=Range("B29"), Order1:=xlDescending, Header:=xlGuess _
      , OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

      To sort the range on Column B. How can I convert this to cfscript so that I can send the command from ColdFusion.