Hi,

I am using the following code...

With oWB.VBProject.VBComponents("ThisWorkbook").CodeModule
StartLine = .CreateEventProc("Open", "Workbook") + 1
.InsertLines StartLine, "MsgBox ""Hello World"",vbokonly"


End With
when I run it, the VBE window shows up and then disappears.
I would like to hide the VBE window from popping up.

I have tried following without any success


oExcel.EnableEvents = False
oExcel.Application.Visible = False
oExcel.Application.ScreenUpdating = False
oExcel.VBE.MainWindow.Visible = False
oExcel.Application.WindowState = xlMinimized

I hope I have made myself clear.

V