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
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