The only thing I can offer is a workaround based on https://stackoverflow.com/a/7479837/17017616
First you create a named Range
for the the cells you do not want the user add/remove rows and/or columns. In my example the name of that range is protected_Area
and it spreads over 32 cells in total.
Next you add this code to the worksheet.
Private Sub Worksheet_Change(ByVal Target As Range)
Const referenceCellCount = 32
Static recursionGuard As Boolean
Dim rngProt As Range
If recursionGuard = True Then
Exit Sub
End If
Set rngProt = ThisWorkbook.Names("protected_Area").RefersToRange
' Adding or removing Rows in the protected area will
' change the size of the range and thus the total count of cells
If referenceCellCount = rngProt.Cells.Count Then
Exit Sub
End If
recursionGuard = True
Application.Undo
recursionGuard = False
MsgBox "Foo must not..."
End Sub
Make sure that referenceCellCount
matches your case.