Variable not declared: <name>

You referred to an undeclared variable while the Option Declare statement was in effect. Implicit declarations are illegal when Option Declare is in effect.

Declare the variable, or remove the Option Declare statement.