Sub or function not defined You declared a sub or function with a Declare statement, and then tried to call it before defining it with a Sub or Function statement. Define the function or sub.