Hi,
Does anyone know how to sort an excel speadsheet? I have a C# app that does almost everything else but when I try and sort I get an ojbect reference error!
I have tried running excel and record a macro but the resulting code is uncomplete and only has 9 args and the C# will not run unless all are specified correctly.
...
oSheet.get_Range("A2", "M" + intLastRow).Select();
oSheet.Rows.Sort("A2", Excel.XlSortOrder.xlAscending, "E2", Type.Missing, Excel.XlSortOrder.xlAscending, "G2", Excel.XlSortOrder.xlAscending, Excel.XlYesNoGuess.xlNo ,0 , false, Excel.XlSortOrientation.xlSortRows,Excel.XlSortMet hod.xlPinYin, Excel.XlSortDataOption.xlSortNormal, Excel.XlSortDataOption.xlSortNormal,Excel.XlSortDa taOption.xlSortNormal);
...
Regards
Joolz