newparadigmz
asked on
Excel VBA "Cannot Parse Condition." error message
I am running a VBA script that reads emails subject lines in my Outlook Inbox and copies attachments in the emails to a folder. The subject lines are stored on a worksheet. It works except when the subject line contains a ":". Below is the error message I get, the offending code, and the subject that it's breaking on.
Run-time error
Cannot Parse Condition. Error at ":".
For i = 1 To UBound(avTable)
strFilter = "[Subject] = " & avTable(i, 1)
For Each itm In avTodayItems.Restrict(strF ilter)
For Each att In itm.Attachments
strFilename = LCase(att.Filename)
If LCase(strFilename) = LCase(avTable(i, 2)) Then
att.SaveAsFile [nmFolder] & avTable(i, 3)
End If
Next att
Next itm
Next i
strFilter = "[Subject] = File 15.08.2012: Daily"
Run-time error
Cannot Parse Condition. Error at ":".
For i = 1 To UBound(avTable)
strFilter = "[Subject] = " & avTable(i, 1)
For Each itm In avTodayItems.Restrict(strF
For Each att In itm.Attachments
strFilename = LCase(att.Filename)
If LCase(strFilename) = LCase(avTable(i, 2)) Then
att.SaveAsFile [nmFolder] & avTable(i, 3)
End If
Next att
Next itm
Next i
strFilter = "[Subject] = File 15.08.2012: Daily"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER