Set a reference to the "Microsoft Visual Basic for Applications Extensibility 5.3" libary so you can code using the VBE, and use a macro to call a function like this:
Code:
Function CloseVBE()
On Error Resume Next
Dim editor As VBE
Set editor = Application.VBE
editor.MainWindow.SetFocus
SendKeys "%{F4}"
End Function
You can code [tt]editor.MainWindow.Close[/tt] but it will trigger an error. Using SendKeys simulates the user shutting down the window.
VBSlammer
"You just have to know which screws to turn." - Professor Bob
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.