Programmatically add an MSGraph chart as a user-defined custom graph type
Problem
PowerPoint (or rather MSGraph) allows a user to manually create and format a graph in a specific style, then add it to a list of user-defined custom graph formats that can be re-used later as though they were MSGraph's own predefined formats.
Transporting these styles from one computer to another is difficult at best; adding my custom styles to your PowerPoint installation would require deleting all of your custom styles. Not good.
But by expanding on the code below, you could add each chart in a presentation to a user's set of custom chart styles, without harming their existing styles in any way.
Solution
This code will add the currently selected graph as a custom graph type:
Sub SaveChartAsAutoformat() Dim oGraphChart As Object Set oGraphChart = ActiveWindow.Selection.ShapeRange(1).OLEFormat.Object With oGraphChart.Application ' give it a name and a description: Call .AddChartAutoFormat("ChartName", _ "This is the description of the chart.") ' or to remove: ' .DeleteChartAutoFormat ("BogusChart") End With End Sub
Search terms:autoformat,custom,chart,msgraph,graph