If you want to prevent the user from sorting on a specific column, call the SSSetColUserSortIndicator function and set the parameters as follows:
Set the Col parameter to specify the column.
Set the nColUserSortIndicator parameter to 3 (SS_COLUSERSORTINDICATOR_DISABLED).
Call the SSSetUserColAction function and set the nUserColAction parameter as follows to specify what action to perform when the user clicks any column header:
If you want a column to be sorted when the user clicks a column header and to display the sort indicator, set the nUserColAction parameter to 1 (SS_USERCOLACTION_SORT).
If you want a column to be sorted when the user clicks a column header and to not display the sort indicator, set the nUserColAction parameter to 2 (SS_USERCOLACTION_SORTNOINDICATOR).
If your sheet displays multiple headers and you want the sort indicator to display in a row other than the bottom-most header row, specify which column header row will display the indicator by calling the SSSetColHeadersUserSortIndex function.