VBA RegExp causes Compile error while vbscript.regexp works
outlook, regex, vba
Solution
Probably only missing some dependencies, meaning some references should be added.
Go to `Tools -> References ->` Find & check the "Microsoft VBScript Regular Expressions" (1.0 or 5.5 both work for me).
Problem
I was writing a script for VBA, for Outlook 2013, that uses regular expressions and every example I find seems to use `Set regex = New RegExp` to create a RegExp object. When I tried this I got Compile error: User-defined type not defined. I managed to get regular expressions to work using `Set regex = CreateObject("vbscript.regexp")`. Any reason why the first options is not working?