[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 !
[Solved] Re: Sort excel file
Excellent thanks !
i had actually looked at MSDN .. so i used "range("a2") and it did not work... did not know i had to use "osheet" as well :)
thanks !