Not sure why you're getting a type mismatch, I just get a compile error.
Anyway, (for all I know about what you're doing) this seems like a bit more code than needed. From what I can tell, all you'd need would be:
in a standard module. (Assuming mainMenu is a userform, they can't show without loading first so you don't need to tell it to load beforehand.)
Hope it helps. (If it doesn't then perhaps you can elaborate a bit.)