I have an Excel VBA script that references Outlook objects. This used to run in prior Office versions.
With Office 2016 and I am getting:
Run-time error '287':
Application-defined or object-defined error
Here is part of my code:
Dim olApp As Outlook.Application
Dim olNS As Outlook.Namespace
Dim Rec As Outlook.Recipient
Dim olGAL As Outlook.AddressList
Set olApp = Outlook.Application
Set olNS = olApp.GetNamespace("MAPI")
Set olGAL = olNS.GetGlobalAddressList
Set Rec = olNS.CreateRecipient(Cells(1, 1))
Rec.Resolve
Cells(1,1) contains a valid email address.
The '287' error comes in on Rec.Resolve
.
I have Microsoft Office 16.0 Object Library checked in Tools/References.
I checked Trust Center Settings in Outlook under Programmatic Access. There are three radio button choices about suspicious activity handling which are all unchecked. My antivirus status is set to Valid.