Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close Visual Basic Editor using code

Status
Not open for further replies.

VBAva

Programmer
Jul 29, 2003
87
IE
Is it possible to close the VBE by using code??

i have a macro that runs and inserts code into a new workbook that is opened up, but when the code is inserted into the new workbook, the VBE opens and shows the code. i dont want this to happen. is there anyway to either stop the editor opening or to close it once it is open.

the application.Quit command closes Excel and i have tried many different things like

Windows("Microsoft Visual Basic").Quit
Application("Microsoft Visual Basic").Quit
Application("Microsoft Visual Basic").Close
Application.Windows("Microsoft Visual Basic").Close
Application.VBE.Close/Quit/Exit

im sure there is a command out there somewhere that will work, i just cant seem to find it.

Any ideas??
 
Actually it is much easier than i thought :)
just use the send keys command

SendKeys "%{F4}", True ' Send ALT+F4 to close

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top