Das Ganze hat mir keine Ruhe gelassen. Leider sind die zeigt die von Heb angegebene Seite keine SVG-Daten, sondern nur darauf beruhende *.webP-Dateien. Also habe ich mal ein bisschen gegoogelt und habe eine Seite mit zumindest ein paar SVG-Flaggen gefunden. Darauf basierend habe ich mal die Kanada-Flagge für Excel nachgebastelt. Hier der Code:
Code: Alles auswählen
Sub Canada_Flag()
'SVG-Code von https://fontawesomeicons.com/svg/icons/Canada-flag
Dim cnt As Long
'Flaggenrechteck erstellen (nicht sichtbar)
With ActiveSheet.Shapes.BuildFreeform(msoEditingAuto, 2.574219, 5.546875)
.AddNodes msoSegmentLine, msoEditingAuto, 27.253906, 5.546875
.AddNodes msoSegmentLine, msoEditingAuto, 27.253906, 23.695312
.AddNodes msoSegmentLine, msoEditingAuto, 2.574219, 23.695312
.AddNodes msoSegmentLine, msoEditingAuto, 2.574219, 5.546875
With .ConvertToShape
.Fill.Visible = msoFalse
.Line.Visible = msoFalse
End With
End With
'Bereich für weißes Rechteck in der Mitte der Flagge (nicht sichtbar)
With ActiveSheet.Shapes.BuildFreeform(msoEditingAuto, 9, 5.546875)
.AddNodes msoSegmentLine, msoEditingAuto, 21, 5.546875
.AddNodes msoSegmentLine, msoEditingAuto, 21, 23.695312
.AddNodes msoSegmentLine, msoEditingAuto, 9, 23.695312
.AddNodes msoSegmentLine, msoEditingAuto, 9, 5.546875
With .ConvertToShape
.Fill.Visible = msoFalse
.Line.Visible = msoFalse
End With
End With
'Linkes rotes Shape
With ActiveSheet.Shapes.BuildFreeform(msoEditingAuto, 5.328125, 5.546875)
.AddNodes msoSegmentCurve, msoEditingCorner, 3.8125, 5.546875, 2.585938, 6.796875, 2.585938, 8.339844
.AddNodes msoSegmentLine, msoEditingAuto, 2.585938, 20.902344
.AddNodes msoSegmentCurve, msoEditingCorner, 2.585938, 22.445312, 3.8125, 23.695312, 5.328125, 23.695312
.AddNodes msoSegmentLine, msoEditingAuto, 9.433594, 23.695312
.AddNodes msoSegmentLine, msoEditingAuto, 9.433594, 5.546875
.AddNodes msoSegmentLine, msoEditingAuto, 5.328125, 5.546875
With .ConvertToShape
.Fill.ForeColor.RGB = RGB(255 * 83.529663 / 100, 255 * 16.859436 / 100, 255 * 11.759949 / 100)
.Line.Visible = msoFalse
End With
End With
'Rechtes rotes Shape
With ActiveSheet.Shapes.BuildFreeform(msoEditingAuto, 24.503906, 5.546875)
.AddNodes msoSegmentLine, msoEditingAuto, 20.394531, 5.546875
.AddNodes msoSegmentLine, msoEditingAuto, 20.394531, 23.695312
.AddNodes msoSegmentLine, msoEditingAuto, 24.503906, 23.695312
.AddNodes msoSegmentCurve, msoEditingCorner, 26.015625, 23.695312, 27.242188, 22.445312, 27.242188, 20.902344
.AddNodes msoSegmentLine, msoEditingAuto, 27.242188, 8.339844
.AddNodes msoSegmentCurve, msoEditingCorner, 27.242188, 6.796875, 26.015625, 5.546875, 24.503906, 5.546875
.AddNodes msoSegmentLine, msoEditingAuto, 24.503906, 5.546875
With .ConvertToShape
.Fill.ForeColor.RGB = RGB(255 * 83.529663 / 100, 255 * 16.859436 / 100, 255 * 11.759949 / 100)
.Line.Visible = msoFalse
End With
End With
'Weißes Shape in der Mitte
With ActiveSheet.Shapes.BuildFreeform(msoEditingAuto, 9.433594, 5.546875)
.AddNodes msoSegmentLine, msoEditingAuto, 20.394531, 5.546875
.AddNodes msoSegmentLine, msoEditingAuto, 20.394531, 23.695312
.AddNodes msoSegmentLine, msoEditingAuto, 9.433594, 23.695312
.AddNodes msoSegmentLine, msoEditingAuto, 9.433594, 5.546875
With .ConvertToShape
.Fill.ForeColor.RGB = RGB(255 * 93.328857 / 100, 255 * 93.328857 / 100, 255 * 93.328857 / 100)
.Line.Visible = msoFalse
End With
End With
'Ahornblatt
With ActiveSheet.Shapes.BuildFreeform(msoEditingAuto, 15.335938, 17.492188)
.AddNodes msoSegmentCurve, msoEditingCorner, 16.15625, 17.589844, 16.890625, 17.675781, 17.675781, 17.769531
.AddNodes msoSegmentLine, msoEditingAuto, 17.503906, 17.070312
.AddNodes msoSegmentCurve, msoEditingCorner, 17.46875, 16.949219, 17.515625, 16.816406, 17.613281, 16.738281
.AddNodes msoSegmentLine, msoEditingAuto, 19.996094, 14.761719
.AddNodes msoSegmentLine, msoEditingAuto, 19.5, 14.523438
.AddNodes msoSegmentCurve, msoEditingCorner, 19.285156, 14.445312, 19.34375, 14.320312, 19.421875, 14.019531
.AddNodes msoSegmentLine, msoEditingAuto, 19.785156, 12.671875
.AddNodes msoSegmentLine, msoEditingAuto, 18.402344, 12.96875
.AddNodes msoSegmentCurve, msoEditingCorner, 18.265625, 12.988281, 18.175781, 12.902344, 18.15625, 12.816406
.AddNodes msoSegmentLine, msoEditingAuto, 17.976562, 12.183594
.AddNodes msoSegmentLine, msoEditingAuto, 16.882812, 13.433594
.AddNodes msoSegmentCurve, msoEditingCorner, 16.726562, 13.636719, 16.414062, 13.636719, 16.511719, 13.171875
.AddNodes msoSegmentLine, msoEditingAuto, 16.980469, 10.636719
.AddNodes msoSegmentLine, msoEditingAuto, 16.351562, 10.96875
.AddNodes msoSegmentCurve, msoEditingCorner, 16.175781, 11.066406, 16, 11.085938, 15.902344, 10.90625
.AddNodes msoSegmentLine, msoEditingAuto, 15.035156, 9.253906
.AddNodes msoSegmentLine, msoEditingAuto, 15.035156, 9.296875
.AddNodes msoSegmentLine, msoEditingAuto, 15.035156, 9.253906
.AddNodes msoSegmentLine, msoEditingAuto, 14.167969, 10.90625
.AddNodes msoSegmentCurve, msoEditingCorner, 14.070312, 11.085938, 13.894531, 11.066406, 13.71875, 10.96875
.AddNodes msoSegmentLine, msoEditingAuto, 13.089844, 10.636719
.AddNodes msoSegmentLine, msoEditingAuto, 13.558594, 13.171875
.AddNodes msoSegmentCurve, msoEditingCorner, 13.65625, 13.636719, 13.339844, 13.636719, 13.183594, 13.433594
.AddNodes msoSegmentLine, msoEditingAuto, 12.089844, 12.183594
.AddNodes msoSegmentLine, msoEditingAuto, 11.914062, 12.820312
.AddNodes msoSegmentCurve, msoEditingCorner, 11.890625, 12.902344, 11.800781, 12.988281, 11.667969, 12.96875
.AddNodes msoSegmentLine, msoEditingAuto, 10.28125, 12.671875
.AddNodes msoSegmentLine, msoEditingAuto, 10.644531, 14.023438
.AddNodes msoSegmentCurve, msoEditingCorner, 10.722656, 14.320312, 10.785156, 14.445312, 10.566406, 14.527344
.AddNodes msoSegmentLine, msoEditingAuto, 10.074219, 14.761719
.AddNodes msoSegmentLine, msoEditingAuto, 12.457031, 16.742188
.AddNodes msoSegmentCurve, msoEditingCorner, 12.550781, 16.816406, 12.597656, 16.949219, 12.566406, 17.074219
.AddNodes msoSegmentLine, msoEditingAuto, 12.355469, 17.773438
.AddNodes msoSegmentLine, msoEditingAuto, 14.730469, 17.492188
.AddNodes msoSegmentCurve, msoEditingCorner, 14.804688, 17.492188, 14.851562, 17.53125, 14.851562, 17.617188
.AddNodes msoSegmentLine, msoEditingAuto, 14.707031, 20.203125
.AddNodes msoSegmentLine, msoEditingAuto, 15.359375, 20.203125
.AddNodes msoSegmentLine, msoEditingAuto, 15.214844, 17.617188
.AddNodes msoSegmentCurve, msoEditingCorner, 15.214844, 17.53125, 15.261719, 17.492188, 15.335938, 17.492188
.AddNodes msoSegmentLine, msoEditingAuto, 15.335938, 17.492188
With .ConvertToShape
.Fill.ForeColor.RGB = RGB(255 * 83.529663 / 100, 255 * 16.859436 / 100, 255 * 11.759949 / 100)
.Line.Visible = msoFalse
End With
End With
cnt = ActiveSheet.Shapes.Count
With ActiveSheet.Shapes.Range(Array(cnt, cnt - 1, cnt - 2, cnt - 3, cnt - 4, cnt - 5)).Group
.Height = .Height * 10
.Width = .Width * 10
End With
End Sub
Nun aber gute Nacht, sofern davon noch was übrig ist.
Gruß Mr. K.