You used the Option Explicit statement at the beginning of your script, but later attempted to use an undeclared variable name. When you use the Option Explicit statement, you must explicitly declare all variables using the Dim, Private, Public, or ReDim statements.
To correct this error
-
When using the Option Explicit statement, make sure you declare all variables using the Dim, Private, Public, or ReDim statement.