Is the VBIDE library open?
I think that the VBEditor.MainWindow is only avaliable through the VBIDE.
From the VBEditor Tools menu> References, the
Microsoft Visual Basic for Application Extensibility library should be open.
(This is from memory, a slightly different name may be what you see.)
Bookmarks