I have a macro to build a consolidated PowerPoint presentation from about 25 separate, individual slides. The slides have a status circle that are either red, yellow or green to display the current status. I want to pull the color of these shapes and put into an excel file. I have tried using the shape index number to reference the shape in my code, but the index for the particular shape changes on every slide; it is not consistent. The Shape ID seems to be consistent, but I cannot figure out how to use the Shape ID in VBA. This is what I'm currently using:
With ActivePresentation.Slides(IForLoop).Shapes(8).Fill.ForeColor
data = ActivePresentation.Slides(IForLoop).Shapes(8).Fill.Forecolor
If Instr(1 , data, "255"), Then
LArray (I, sStatus) = "Red"
ElseIf InStr(1, data, "65535") Then
LArray (I, sStatus) = "Yellow"
ElseIf InStr(1, data, "5287936") Then
LArray (I, sStatus) = "Green"
End If
The problem is that the Shape reference, Shape(8), is not consistent for each slide so I'm not getting the correct color name to populate in my Excel file.
Thank you.