Closing VBA editior programmatically

S

Shatin

I have a macro which ends like this:

With ActiveWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule
StartLine = .CreateEventProc("BeforeClose", "Workbook") + 1
.InsertLines StartLine, _
"Msgbox ""Blahblahblahblah...."",vbOkOnly"
End With

When I run the macro, it does whatever it has to do and then ends by
displaying the code module window with the above code. This will
puzzle my friends who will run the macro since they don't know a thing
about VBA. How can I close the VBA editor programmatically?

Thanks in advance!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top