Outlook 2013 Cannot run script from rule

leprendun

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server
#1
I keep running into the following error message whenever I try running an Outlook rule that runs a script when triggered by particular words in the subject line:

The script "" doesn't exist or is invalid.​

I am able to select my macro during the rule creation stage, and have successfully run the macro as a stand-alone script rather than connected to a rule. I am able to successfully run other scripts from Outlook rules. I have deleted and re-created the rule. I have restarted Outlook. I have pasted the code into a new module. I have even created the following test script to run from a rule:

Sub PrintInvoice(Message As Outlook.MailItem)
MsgBox "I work!"
End Sub
and the rule still doesn't work! At this point I'm assuming something is wrong with my Outlook or VBA setup. Any ideas on how to troubleshoot this problem?
 

leprendun

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server
#3
It works here. Did you try deleting the rule and recreating it? Is the macro in a module or in ThisOutlookSession? It should be in a module.
I've tried deleting and recreating the rule several times, even restarting Outlook after each step. The macro is stored in a module. I'm stumped...
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#4
Other macros work, correct? If not, then it's macro security... but that macro, as written, works in a simple rule that triggers it for every message that arrives. If you have a many conditions, try removing some/all and see if it works.
 

leprendun

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server
#5
Other macros work, correct? If not, then it's macro security... but that macro, as written, works in a simple rule that triggers it for every message that arrives. If you have a many conditions, try removing some/all and see if it works.
Other macros work, even macros called from a rule. My macro security settings are set to minimal security. I removed all conditions on the rule so that it would apply to every new message and I still received the error. I can't think of any way to make this more basic! I changed the rule to run another script and then it worked. What would cause a one-line script to fail? Is there perhaps a limit on how many scripts can be called from Outlook rules? Or perhaps this module has a different setting than the working modules in VBA? Something wrong my Outlook installation?

Thanks for struggling through this with me :)
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#6
How many run a script rules do you have? Not that i think its because you have too many, otherwise the new script you tried in the rule would fail. The script itself works here, so it's not the script. Do you have another script called PrintInvoice? If you rename it, does it work?
[DOUBLEPOST=1443208354][/DOUBLEPOST]How many run a script rules do you have? Not that i think its because you have too many, otherwise the new script you tried in the rule would fail. The script itself works here, so it's not the script. Do you have another script called PrintInvoice? If you rename it, does it work?
 

leprendun

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server
#7
I finally got it to work, but no idea what did it. I kept deleting and recreating the rule, putting the code in a new module, renaming the sub, etc. Thanks for your help.
 
Top