No, a solve block is not allowed inside a program. At least, not the way you are trying to do it, by putting the given and find inside the program. That is not allowed. You have to turn the solve block into a function, and call the function from the program, which is what is done in the worksheet I posted. I didn't realize you were working with MC13, so here's the MC13 version of the file. The regions highlighted in green are the modifications I made from the first file.
Note that Alan's worksheet finds one set of constants that best satisfies all the elements in your matrices at once. Mine finds one set of constants for each element of the matrix, which is what I thought you were after.