I have created an option on the toolbar of my Add-in to sort row with a few more features than what is offered with Excel's built in sort. Since the sort Dialog does not work on Pivot Tables I have created an error screen to tell my users why the feature would not work. (One thing microsoft is terrible at is error screens) Here is my code:

[VBA]If IsInPivotTable(ActiveCell) Then
Error005.Show
End
End If[/VBA]

and the rest is the functions you supplied me