I have an outlook macro that wants to do a vlookup in an excel file. I keep getting the run time error "Object doesn't support this property or method".
Function GetEmailAction(email As String)
Dim answer As String
Dim xl As Object
Dim wb As Object
Dim ws As Object

Set xl = CreateObject("Excel.Application")
Set wb = xl.Workbooks.Open("C:\Users\Public\Documents\CRM\Outlook\emailidlist.xlsm")
Set ws = wb.ActiveSheet
 
answer = xl.ws.VLookup(email, ws.Range("emails"), 2, False)
In Excel, I use Application.VLookup and it works. I have tried many combinations but I cant find the one that works.

Anyone know? Thanks very much