This script is working well in 2023 but why not working in 2024. Not only this... there are many like this only

Sub SwapFills()
Dim shapeRange As shapeRange
Dim shape1 As Shape
Dim shape2 As Shape
Dim tempFill As Fill

Set shapeRange = ActiveSelectionRange
Set shape1 = shapeRange(2)
Set shape2 = shapeRange(1)

Set tempFill = shape1.Fill.GetCopy
shape1.Fill.CopyAssign shape2.Fill
shape2.Fill.CopyAssign tempFill
End Sub