I might have just found the issue. Main is a function, not a sub. Could this be the problem?
below are the parameter types, hierarhcy() is a string:
Function main(dte As Date, parentName$, RESPORG$, UNIT$, lvl$, hierarchy() As String, PERF#, date_list As Object, ProjStatus As Boolean, ProjDate...