Hi all,

As a total newby to VBA (and coding in general) it took me for ages to build a little macro to make a 4 dimensional bubble plot.
Although i now finally have the macro running in excel 2013 on windows, it does not seem to work in excel 2016 on the mac.
I'm getting a "Run time error 438, Object doesn't support this property or method" at 'Set shap = ActiveSheet.Shapes.AddChart2(269, xlBubble)'.

Does anyone know what the problem is and if there is a solution? (below the first part of the code until it gives the error)

Thank you kindly in advance!

Regards JJ


Sub Create4DBubbleGraph()
' First get the selected range
    Dim r As Range
    Dim s As String
    Dim cht As Chart
    Dim shap As Shape
    
    If TypeName(Selection) <> "Range" Then
        MsgBox "Invalid selection"
        Exit Sub
    End If
    
    If Selection.Areas.Count <> 1 Then
        MsgBox "Invalid selection"
        Exit Sub
    End If
    Set r = Selection
    
    If r.Columns.Count <> 4 Then
        MsgBox "Selecteer de data in volgende vier variabelen: Opstelling, activiteit, invloed, relatie"
        Exit Sub
    End If

' Next delete an already existing chart
    On Error Resume Next
        Sheets("Actorenanalyse").Shapes("chartActorenanalyse").Delete
    On Error GoTo 0
        
' Next create the chart
    Set shap = ActiveSheet.Shapes.AddChart2(269, xlBubble)