Random CMYK Colours - I tried Bard and got this... below script, but this is not working, please someone correct this

Sub ApplyRandomCMYKColors()

Dim s As Shape
Dim color As CMYKColor

For Each s In ActiveSelectionRange
' Generate random CMYK values within a specified range
Set color = New CMYKColor
color.Cyan = Rnd() * 100
color.Magenta = Rnd() * 100
color.Yellow = Rnd() * 100
color.Black = Rnd() * 100

' Apply the random color to the selected object's fill
s.Fill.UniformColor = color
Next s

End Sub

Parents Reply Children