The code reads the lines from Excel in column "A", looks for them in Outlook and downloads the attached file to the folder that is in range("E3"), which changes depending on the computer.
But, on my computer it works perfectly, on my colleagues' computer it doesn't download the files.
Sub Descarga()
Dim it, at As Variant, t As Long
Dim olApp As Outlook.Application
Dim olNS As Outlook.Namespace
Dim olFolder As Outlook.MAPIFolder
Dim olItem As Object
Dim mailitem As Outlook.mailitem
Dim olAtt As Outlook.Attachment
Set olApp = New Outlook.Application
Set olNS = olApp.GetNamespace("MAPI")
Set olFolder = olNS.GetDefaultFolder(olFolderInbox)
For Each it In CreateObject("outlook.application").GetNamespace("MAPI").GetDefaultFolder(6).Items
For t = 1 To Range("A" & Rows.Count).End(xlUp).Row
If InStr(it.Subject, Cells(t, 1)) Then
For Each at In it.Attachments
at.SaveAsFile (Range("E3")) & "\" & at.DisplayName 'Range("E3") is the path
Next
End If
Next
Next
End Sub