尝试使用VBA将我的Outlook电子邮件导入Excel

我试图导入我的Outlook电子邮件到Excel使用VBA,但卡住了我不知道的错误。 我真的很感谢这种支持。

Sub GetFromOutlook() Dim OutlookApp As Outlook.Application Dim OutlookNamespace As Namespace Dim Folder As MAPIFolder Dim OutlookMail As Variant Dim i As Integer Set OutlookApp = New Outlook.Application Set OutlookNamespace = OutlookApp.GetNamespace("MAPI") Set Folder = OutlookNamespace.GetDefaultFolder(olFolderInbox) i = 1 For Each OutlookMail In Folder.Items 'Getting Error in the below Line "Method Range of object'_Global" failed' *If OutlookMail.ReceivedTime >= Range("From_date").Value Then* Range("eMail_subject").Offset(i, 0).Value = OutlookMail.Subject Range("eMail_date").Offset(i, 0).Value = OutlookMail.ReceivedTime Range("eMail_sender").Offset(i, 0).Value = OutlookMail.SenderName Range("eMail_text").Offset(i, 0).Value = OutlookMail.Body i = i + 1 End If Next OutlookMail Set Folder = Nothing Set OutlookNamespace = Nothing Set OutlookApp = Nothing End Sub