Results 1 to 3 of 3

Thread: [VB2005] [Resolved] Sort excel file

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2007
    Posts
    174

    Resolved [VB2005] [Resolved] Sort excel file

    Hello
    I am getting a "COMExecption unhandeld" at this line of code...

    Code:
      oSheet.Range("A2", "G" & EndRows).Sort("A2", Excel.XlSortOrder.xlAscending, "B2", Excel.XlSortOrder.xlAscending)
    EndRows is defined as the last row
    oSheet as excel worksheet
    Trying to ignore the first row (title) therefore the range is A2 => G....
    And trying to sort on two columns, A and B....

    What am i doing wrong ?

    Thanks !
    Last edited by Zoroxeus; Jan 3rd, 2008 at 10:08 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width