It is because each element in sheet_array() is a Variant type, but your create_header_row_new_combined_file() sub expects to be passed a String type. You can either explicitly cast to a String (recommended approach for which I would use CStr()), or you can force it to be passed ByVal by surrounding it with brackets.
Alternatively, of course, you could change the parameter declaration in create_header_row_new_combined_file so it expects aVariant or the argument to be passed ByVal, or you could change the sheet_array() declaration so it is a String array and populate it using Split() rather than Array().
Bookmarks