Microsoft actually built that already, then they decided to kill it. It was called VSTA (not to be confused with VSTO). It shipped with one of the apps of Office 2007.
At first I thought you were referring to VSTO, then I saw the "not to be confused with VSTO" part. I had no idea this ever existed. Thanks for mentioning it. I wonder why they decided to pull the plug back then.
I suspect it must have been part of "let's try to secure / lockdown office", "users writing codes is bad, they should only push buttons", and at the same time they tried to make it as hard as possible to use VBA (all sorts of warnings and things disabled by default, etc)