View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Shatin Shatin is offline
external usenet poster
 
Posts: 54
Default Closing VBA editior programmatically

I have a macro which ends like this:

With ActiveWorkbook.VBProject.VBComponents("ThisWorkboo k").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!