Problem Sorting Excel Range in VBS

  • Thread starter Thread starter thejedi
  • Start date Start date
T

thejedi

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top