Honestly not sure why it won't work, but you gain a huge benefit over doing it the way shg offered.
By using the codename you will ensure your code always works without having to trap for some type of error.
What if a user change your sheet name from Tasks to something else?
Your code will fail, but with the codename you can ensure it will always work.