I beleive your error is here
function startupFcn(app, MainApp, a, b, c)
app.CallingApp = mainApp;
Should be
app.CallingApp = MainApp;
Make that change, save the app, close the app, restart it, and test it. If the problem persists, I'd be glad to look further.
Best Answer