This my simplified script:
Sub SomeOtherSub(Stattyp As String)
'Daty and the other variables are defined here
CatSubProduktAreakum(Stattyp, Daty + UBound(SubCategories) + 2)
End Sub
Sub CatSubProduktAreakum(Stattyp As String, starty As Integer)
'some stuff
End Sub
The call of CatSubProduktAreakum is marked red as a "syntax error". I don't understand the error. It is a simple sub-routine call with two arguments. Why does VBA not accept the call?