Graham's code worked for me as does my modification of your code.
Does the activeworkbook have a sheet named Summary? Obviously, a shape must be selected before running as well.
Sub Main()
Dim LastRow As Long
Dim ws As Worksheet
Dim shp As Shape
Dim R As Integer, G As Integer, B As Integer
Dim colr As Double
On Error GoTo EndNow
If VarType(Selection) <> 9 Then Exit Sub
Set shp = ActiveSheet.Shapes(Selection.Name)
colr = shp.Fill.ForeColor.RGB
R = colr Mod 256
G = (colr \ 256) Mod 256
B = (colr \ 256 \ 256) Mod 256
With Worksheets("Summary")
LastRow = .Range("A" & Rows.Count).End(xlUp).Row + 1
.Range("C" & LastRow).Value = R
.Range("D" & LastRow).Value = G
.Range("E" & LastRow).Value = B
.Range("B" & LastRow).Interior.Color = RGB(R, G, B) 'RGB() or colr
.Select
.Range("B" & LastRow).Select
End With
EndNow:
End Sub