Change Dim strIn as String to Dim strIn as Variant. See edited post above.