Excel 2013不连接到Outlook MAPI

在Excel 2007上运行时,此代码运行良好.11月17日我升级到Office 356,现在我无法访问自11月17日以来到达Outlook 2013的MAPI电子邮件。 看起来MAPI不同步。 请协助。

Public Sub sbImportEmails() Dim olApp As Object Dim olNS As Object Dim olFolder As Object Dim olAnswer As Object, olMsg As Object Dim myName As Object Dim Column As String Dim intLastRow As Integer Dim inx As Integer Application.Calculation = xlCalculationManual Set olApp = GetObject(, "Outlook.Application") If olApp Is Nothing Then Set olApp = CreateObject("Outlook.Application") End If Set olNS = olApp.GetNamespace("MAPI") Set olFolder = olNS.Folders("Mailbox - Job Activity Log Files").Folders("Inbox") 'Set olFolder = olNS.Folders("Job Activity Log Files").Folders("Inbox") Application.ScreenUpdating = False ThisWorkbook.Worksheets("Emails").Activate On Error Resume Next Rows("2:2").Select Range(Selection, Selection.End(xlDown)).Select Selection.Delete Shift:=xlUp Range("A2").Select For inx = 1 To 200 'olFolder.items.Count Set olMsg = olFolder.items(inx) ActiveCell.Offset(0, 0) = olMsg.receivedtime ActiveCell.Offset(0, 1) = olMsg.Subject ActiveCell.Offset(0, 2) = olMsg.SenderEmailAddress ActiveCell.Offset(0, 3) = olMsg.Body ActiveCell.Offset(0, 3).WrapText = False ActiveCell.Offset(1, 0).Select Application.StatusBar = "Currently on Record " & inx & " of " & olFolder.items.Count Next ThisWorkbook.Worksheets("Titles").Activate Application.ScreenUpdating = True Application.StatusBar = False Application.Calculation = xlCalculationAutomatic Set olAnswer = Nothing Set olMsg = Nothing Set olFolder = Nothing Set olNS = Nothing Set olApp = Nothing End Sub