View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jgeniti jgeniti is offline
external usenet poster
 
Posts: 30
Default Keep VBA window hidden

Hi guys.
I'm trying to add an event procedure to my VBA code and I am unable to
supress the VBA window from opening when the macro runs.
I have tried turning off screen updating and making sure that the VBA
window is closed but it still opens when it runs.
Any help would be appreciated.
Thanks
James


Application.ScreenUpdating = False
Application.VBE.MainWindow.Visible = False
With ActiveWorkbook.VBProject.VBComponents("Sheet7").Co deModule
StartLine = .CreateEventProc("BeforeDoubleClick", "Worksheet") + 1
.InsertLines StartLine, "PurchasePartsDblClick"
End With