I've rechecked the posted code and there is no extra right parentesis. perhaps in one of the referenced sub routines
(var_in), (Alert_Msg) or (var_out)
You may also have missed the first opening paren when copying. I have attached a copy of the file in case this was the problem.