I have the following Sub below (which i got form somewhere), which is supposed to creates a csv from a 2D array. it kind o, sort works but there are issues that i am not sure how to resolve. as you can see from the image, notepad is shows unprintable characters in the file. Which i cannot seem to find in the code or remove.
any assistance is greatly appreciate, thank you in advance.
Public Sub SaveCSV(arr_SelectedCMHist() As Variant, path As String, Optional Delim As String = ",", Optional quote As String = """")
Dim opf As Long
Dim row As Long
Dim column As Long
If Dir(path) <> "" Then Kill path
opf = FreeFile
Open path For Binary As #opf
For row = LBound(arr_SelectedCMHist, 1) To UBound(arr_SelectedCMHist, 1)
For column = LBound(arr_SelectedCMHist, 2) To UBound(arr_SelectedCMHist, 2)
Put #opf, , quote & arr_SelectedCMHist(row, column) & quote
If column < UBound(arr_SelectedCMHist, 2) Then Put #opf, , Delim
Next column
If row < UBound(arr_SelectedCMHist, 1) Then Put #opf, , vbCrLf
Next row
Close #opf
End Sub


