View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] thejedi@gmail.com is offline
external usenet poster
 
Posts: 1
Default Problem Sorting Excel Range in VBS

I'm having trouble sorting an Excel spreadsheet in a VBScript file.

I'm connecting to an Access database, and creating my output using the
Excel.Application object.

Here is my code:

objExcelWS.Columns("A:O").Select

objExcelWS.Columns("A:O").Sort key1:=objExcelWS.Columns("D1"),
Order1:=1, key2:=objExcelWS.Range("E1"), Order2:=1,
key3:=objExcelWS.Range("L1"), Order3:=1, Header:=0, OrderCustom:=1,
MatchCase:=False, Orientation:=1

Row 1 has my headers, and I'm getting the error "Expected Statement"
when this line is called.

Thanks in advance!