Solved.
Basically, after editing my solver.xlam, I commented out every line Excel complains about (4 lines in total, each time it uses dlgSolverParameters.refObj or .refVariables). After a couple of runs, it worked, so I closed and reopened Excel (the xlam restored itself), and magically everything worked.
Thank you all.