Illegal reference to: <name>

You used a name as though it contained or referred to a value, but it doesn't. For example:

Sub MySub
   Print "Hello"
End Sub
stringVar$ = MySub     ' Illegal because MySub does not return a value

Remove this use of the name, or replace it with a name that has a value (for example, a function name instead of a sub name).