Sub WriteToExcel()
'don't forget to register your reference to Excel Oject Library!
Dim objXLS, objItem As Object
Dim myfile As String
Dim lastrow As Integer
Dim objOutlook As Outlook.Application
'binding with outlook object library
Set objOutlook = CreateObject("Outlook.Application")
'get active mail item
Set objItem = objOutlook.ActiveExplorer.Selection.Item(1)
myfile = "C:\Temp\TEST.XLS"
'open an Excel application
Set objXLS = CreateObject("excel.application")
objXLS.Application.Visible = True
objXLS.workbooks.Open (myfile) 'open your excel file
objXLS.worksheets(1).Range("A1").Select
' Find the last row
objXLS.Range("A65536").End(xlUp).Select
objXLS.ActiveCell.Offset(0, 1).Value = objItem.ReceivedTime 'remember to always refer to your object
objXLS.ActiveCell.Offset(0, 2).Value = objItem.Subject
objXLS.ActiveWorkbook.Close SaveChanges:=True 'save excel file
objXLS.Quit 'quit excel
Set objXLS = Nothing
Set objOutlook = Nothing
Set objItem = Nothing
End Sub