Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a simple sorting macro like this:
Sub ExpressionSort
Set chart = ActiveDocument.GetSheetObject("chartname")
prop = chart.GetProperties
If prop.Dimensions(0).SortCriteria.SortByExpression = 1 Then
prop.Dimensions(0).SortCriteria.SortByExpression = -1
Else
prop.Dimensions(0).SortCriteria.SortByExpression = 1
End If
chart.SetProperties prop
End Sub
I'd like to reuse this for different objects, but I can't seem to pass the object id along through a parameter. I would expect it to be something like this
Sub ExpressionSort(objectname)
Set chart=ActiveDocument.GetSheetObject(objectname)
But that doesn't work at all.
Nice - that should do it!
Thanks again for the help Michael.