I want to download attachments from Outlook emails.
Here is the code I am using to retrieve emails.
Set OutlookApp = New Outlook.Application
Set OutlookN
I had this issue as well. The only way I could get past it is by running the code IN OUTLOOK VBA (Outlook -> developer tab -> vba), and do not start your application specifically as an outlook application.
example:
Dim olApp As Outlook.Application
Set olApp = CreateObject(Outlook.Application)
would need to become
Dim olApp As Application
Set olApp = Application
The trick is to NOT open a new instance of outlook from outside outlook (IE. in Excel). If you've got any type of Outlook Exchange security settings, opening outlook from excel will prohibit you from accessing key pieces of information such as sender.