in reply to Re: Error in Syntax...
in thread Error in Syntax...

That's the closing brace for the whole sub.