I want to run an Excel macro when email with "subject" is sent to my inbox. I set up run a script in Manage Rules & Alerts in Outlook. When I receive a mail with "subject" nothing happens to the macro.
Sub Test(mail As MailItem)
Dim ExApp As Excel.Application
On Error Resume Next
Set ExApp = GetObject(, "Excel.Application")
If Not ExApp Is Nothing Then
ExApp.Run "'C:\Users\Desktop\Production v2.7.1.xlsm'!Main_function_Auto"
End If
End Sub