def _validate_template_filename(filename: Union[str, Path]) -> Path:
    if isinstance(filename, str):
        filename = Path(filename)
    suffix = filename.suffix
    if not suffix:
        suffix = '.crtx'
    if suffix != '.crtx':
        raise ValueError(f"Extension for the excel template file must be '.crtx' instead of {suffix}")
    return filename.with_suffix(suffix)