Error Message: Run-time error '287': Application-defined or object-defined error

RosieG1991

New Member
Joined
Feb 23, 2017
Messages
21
Hey guys

I use a spread sheet with a Macro built by someone who left my team a year or so ago - Up until now I've had no issues with the Macro.
The Macro pulls data from a mailbox in Outlook. We have recently moved to Windows 10 and I believe that is when the Macro has stopped working.
Please see below the section of the Marco that is getting highlighted when I click the 'Debug' button in the error msg:


'Copy field items in mail folder.

For Each itm In fld.Items

irow = wks.Range("A" &Rows.Count).End(xlUp).Row + 1
If itm.Class = Outlook.OlObjectClass.olMail Then
Set msg = itm
If msg.SentOn > wks.Range("A" &iLast).Value Then
wks.Range("D" & irow) = msg.Subject
wks.Range("A" & irow) = msg.SentOn
wks.Range("B" & irow) = msg.SentOn
wks.Range("F"& irow) = msg.SenderName
wks.Range("G" & irow) =ResolveDisplayNameToSMTP(msg.SenderName)

iSender = wks.Range("F" & irow).Value
iTable =Sheets("Contactlist").Range("Contacts")
If wks.Range("G" & irow) = "" Then
iformula = Application.VLookup(iSender, iTable, 2, False)
If IsError(iformula) Then
wks.Range("G" & irow) = ""
Else
wks.Range("G" & irow) = iformula
End If
End If
If wks.Range("G" & irow) = "" Then
wks.Range("G" & irow) = msg.SenderEmailAddress
End If
End If
End If

Next

irow = Sheets("ACTIVE").Range("A" &Rows.Count).End(xlUp).Row

Sheets("ACTIVE").Range("A" & iLast& ":G" & irow).Sortkey1:=Sheets("ACTIVE").Range("A" & iLast),order1:=xlAscending, Header:=xlNo

Sheets("ACTIVE").Range("A" & iLast& ":G" & irow).NumberFormat = "dd/mm/yyyy"
Sheets("ACTIVE").Range("B" & iLast& ":G" & irow).NumberFormat = "h:mm"

Set appExcel = Nothing


Any help fixing this would be much appreciated!! I can provide the full macro code if needed.

Thank you!!
Rosie
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I know this is a duplicate of my other Thread posted a couple of hours earlier, I realised when I logged back in and looked at it that I had not actually asked for assistance in fixing the issue.

Help still required if possible!
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

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