
Originally Posted by
westconn1
you also need to change it in isfileopen as that function is generating the error 53
H
thank you all for your help. That worked now perfectly!
But now something strange is happening: I used the exact same code now for a different email folder. I want to do the exact same thing, just with a different outlook folder. Same excel sheet (which is now empty) etc.
So I changed the name of the outlook folder. The vba code also finds this outlook folder. But suddenly I get an error 13 "type mismatch".
When I click on debug, it highlight me the "Next Item" in the line "Next Item" in the first line where it wants to go to excel:
...
Next Item
' write everything to Excel
Set xlApp = GetExcelApp
If xlApp Is Nothing Then GoTo ExitProc
If Not IsFileOpen(Environ("USERPROFILE") & "\Desktop\liste_bounced_emails.xlsx") Then
Set xlwkbk = xlApp.Workbooks.Open(Environ("USERPROFILE") & "\Desktop\liste_bounced_emails.xlsx")
End If
....
I do not understand this. It is the exact same code, same excel sheet etc. Why there is now an error, what worked perfectly 5 minutes ago? In this folder, there are over 2400 bounced emails.
What could be the reason for this and how can I fix this?outlook2010_vba_next_item_error_13.jpg