I suggest that you copy the code from
'http://www.rondebruin.nl/win/s1/outlook/openclose.htm
to open Outlook reliably. You don't need to set a reference to Outlook in the VBA project when using the following code
Option Explicit
Sub GetMailInfo()
'Use the following code to access Outlook
'http://www.rondebruin.nl/win/s1/outlook/openclose.htm
'Graham Mayor - http://www.gmayor.com - Last updated - 14 Aug 2018
Dim MyOutlook As Object
Dim msg As Object
Dim x As Object
Dim Path As String
Dim i As Long, Row As Long
Dim strFile As String
Set MyOutlook = OutlookApp()
Set x = MyOutlook.GetNamespace("MAPI")
Path = "C:\FooFolder\email\"
Row = 1
strFile = Dir$(Path & "*.msg")
While strFile <> ""
Set msg = x.OpenSharedItem(Path & strFile)
Cells(Row + 1, 1) = msg.Subject
Cells(Row + 1, 2) = msg.Sender
Cells(Row + 1, 3) = msg.CC
Cells(Row + 1, 4) = msg.To
Cells(Row + 1, 5) = msg.SentOn
If msg.Attachments.Count > 0 Then
For i = 1 To msg.Attachments.Count
Cells(Row + 1, 5 + i) = msg.Attachments.Item(i).FileName
Next i
End If
msg.Close 0
Row = Row + 1
strFile = Dir$()
Wend
End Sub