Invalid procedure call or argument on split mac excel vba
<p>I am not sure why but this <code>cet = Split(strCSV, " - ")</code> causes Run time error 5: Invalid procedure call or argument.</p>

<pre><code>   strCSV = Trim(cWk.Range("P" &amp; i)): dt = CDate(CLng(cWk.Range("H" &amp; i)))
</code></pre>

<blockquote>
  <p>where    str = "Cap Style:Snapback - CD / Number:07 / Color:First Avenger(+S$1.50) / Box:none - Only Purchase 3 caps and above - Free Box "</p>
</blockquote>

<p>Following code works perfectly on windows but it throws error on the above mentioned line</p>

<pre><code>Option Explicit
Option Compare Text
Sub Get_Data()
Application.ScreenUpdating = False

Dim fName, wkB2 As Workbook, cWk As Worksheet, xWk As Worksheet, frowC As Long, i As Long, j As Long, ch As String, num As String
Dim strCSV As String, dt As Date, shtName As String, cet, temp As String, rng As Range, cel As Range, cl As String, rw As Long, toF As String

On Error GoTo Err
fName = Application.GetOpenFilename
If fName &lt;&gt; False Then
Set wkB2 = Workbooks.Open(fName): Set cWk = wkB2.Worksheets(1): frowC = cWk.Range("P" &amp; Rows.Count).End(xlUp).Row

'Cap Style:Baseball - CC / Number:04 / Color:Grey(+S$2) / Box:none - Only Purchase 3 caps and above - Free Box
'Cap Style:SnapBack - CC / Number:04 / Color:Grey(+S$1.50) / Box:none - Only Purchase 3 caps and above - Free Box

For i = 2 To frowC
    strCSV = Trim(cWk.Range("P" &amp; i)): dt = CDate(CLng(cWk.Range("H" &amp; i)))
    If strCSV &lt;&gt; "" And IsDate(dt) Then
     'ERROR  cet = Split(strCSV, " - "): temp = cet(LBound(cet)): cet = Split(temp, ":"): shtName = Trim(cet(UBound(cet)))
        For Each xWk In ThisWorkbook.Worksheets

        If shtName = Trim(xWk.Name) Then

        Set rng = xWk.Range("E3:BD3")
            For Each cel In rng
                If cel.Value = dt Then
                    cet = Split(cel.Address, "$"): cl = cet(UBound(cet) - 1): Exit For
                End If
            Next cel

        cet = Split(strCSV, "Number:"): temp = cet(UBound(cet)): cet = Split(temp, "/"): num = Trim(cet(LBound(cet)))
        cet = Split(strCSV, " / "): temp = cet(LBound(cet)): cet = Split(temp, " - "): ch = Trim(cet(UBound(cet))): ch = ch &amp; "-" &amp; num
        Debug.Print "Ch is " &amp; ch
        Set rng = xWk.Range("A1:A" &amp; xWk.Range("A" &amp; Rows.Count).End(xlUp).Row)
            For Each cel In rng
                If cel.Value = ch Then
                    rw = cel.Row: Exit For
                End If
            Next cel

        cet = Split(strCSV, "Color:"): temp = cet(UBound(cet)): cet = Split(temp, "("): toF = Trim(cet(LBound(cet)))
            For j = rw To rw - 10 Step -1
                If Trim(xWk.Range("B" &amp; j)) = toF Then
                    rw = j: Exit For
                End If
            Next j

        Debug.Print "Address is: " &amp; cl &amp; rw &amp; " for row  " &amp; i
        xWk.Range(cl &amp; rw) = cWk.Range("O" &amp; i)

            Exit For
            End If
        Next xWk

    End If
Next i

wkB2.Close False
Else
    Exit Sub
End If

Application.ScreenUpdating = True
MsgBox "Done"
Exit Sub

Err:
MsgBox Err.Description
End Sub
</code></pre>