VBA error 13:  Type mismatch

Cause:

The data type for the variable is mismatched, i.e. expecting string but actually an integer.

Solution:

Dim variableName as Variant

To fix you can Dim the variable as Variant.  Which will allow any data type for the variable.

Or make sure the actual data type for the variable matches the declared data type.