This check is too generic, testing whether class implements IMacro would be much safer.
Also I'm not sure it's good to show it only once - when template is compiled. I'd rather add this check directly into compiled template.