Run Time Error 287

dav1dw

New Member
Joined
Mar 15, 2018
Messages
4
Hi.

Looked through the forum and couldn't find a response to this particular error.

I have an excel file which loops through emails in a particular folder in Outlook to extract details of the emails.

There are three main properties it's supposed to extract from Outlook: received time, subject and sender name. The VBA works fine for the first two (I.e. received time and subject), but for some reason when it gets to sender name it gives an error for some users (regardless of whether run from a button or by stepping through with F8). The error is "Run-time error '287: Application-defined or object-defined error"

The DIM I am using is:
Dim msg As outlook.MailItem

And the lines which work from the code are:
msg.ReceivedTime
msg.Subject

But the following one causes the above run time error. I have tried using .Sender and .SentOnBehalfOfName but still get the same.
msg.SenderEmailAddress

What are the most likely causes of the error that I could look into ? I'm hoping there's something really simple I can do to resolve ;)

Thanks
Dave
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Before that line, please add:
Debug.Print msg.SenderEmailAddress
What does it print?
 
Upvote 0
There's no "nothing". Is the string empty? -> Debug.Print Len(msg.SenderEmailAddress)
 
Upvote 0
Sounds like a security issue to me. You might want to look into the Redemption dll.
 
Upvote 0
Yeah the string is empty. If I hover over the variable (msg.SenderEmailAddress) it shows:

"msg.SenderEmailAddress = <Application-defined or object-defined error>
 
Upvote 0
many thanks....I have asked around and it appears there has been an issue with some internal security/encryption software. I have nothing to prove that's the cause but maybe that is the issue after all.
 
Upvote 0

Forum statistics

Threads
1,215,851
Messages
6,127,296
Members
449,374
Latest member
analystvar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top