Hello,

I stuck at extracting email body from outlook to excel. Can anyone please help me with this ? I'm getting runtime error 1004
at a line highlighted as red.
Dim oXLApp As Object, oXLwb As Object, oXLws As Object
Dim lRow As Long
On Error Resume Next
Set oXLApp = GetObject(, "Excel.Application")
'If not found then create new instance
If Err.Number <> 0 Then
    Set oXLApp = CreateObject("Excel.Application")
End If
Err.Clear
On Error GoTo 0
'Show Excel
oXLApp.Visible = True
'Open the relevant file
Set oXLwb = oXLApp.Workbooks.Open("\\B:\Test WB.xlsx")
'Set the relevant output sheet. Change as applicable
Set oXLws = oXLwb.Sheets("Output")
lRow = oXLws.Range("A" & oXLApp.Rows.Count).End(xlUp).Row
lRow = lRow + 1
Thank You.