I have a macro in Outlook named "DeleteMail", when I try to run it from excel somehow I get an error "438".
I think I'm missing something on before the last line.
Function OpenOL(Optional ProfileName) As Object
Dim objOL As Object
'On Error Resume Next
Set objOL = GetObject(, "Outlook.Application")
If objOL Is Nothing Then
Set objOL = CreateObject("Outlook.Application")
objOL.Session.Logon ProfileName, , False, True
End If
Set OpenOL = objOL
Call OpenOL.DeleteMail '***Error Here****
Set objOL = Nothing
End Function
Any help is appreciated.
Nick.