VBE Window Popping Up

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Howdy helpful people in excel.programming land
I'm using CodeModule.CreateEventProc to insert code into sub Workbook_Open of a sheet I'm creating via VBA. Everything works fine, but at the end of the insertion, the VBE opens automatically. I can definitely see why this would be good in most cases, but these sheets are being created quite often and it's very annoying
I've tried a number of things with no success, but I'm hoping it's something simple I've just missed

Thanks in advance, agai
Dustin Carter
 
Hi

Try putting the following as the last line of your code

Application.Visible = True

That should return to the Excel application rather than the VBE window

Simon
 
If you move the window off the screen, the most you have to endure is
the button in the taskbar:

With ThisWorkbook.VBProject.VBE.MainWindow
.Left = -1.5 * .Width
End With
 
Thanks for the tips, and I've implemented the application.visible = true fix, but..
...
Why on earth isn't there a way to prevent my macro from harassing the user? I find this completely unacceptable on Microsoft's part. The entire purpose behind VBA automation is to work behind-the-scenes. There are hundreds of reasons why you'd want to modify code without notifying/pestering the user. A VBE window full of very kludgy code (because of the way I'm forced to work around adding references to on-the-fly created sheets) is very intimidating to the users I'm automating Excel for, not to mention annoying to the developer who's trying to debug code while VBE windows are popping up
Anyway, thanks again for the workarounds. It's sad that we have to spend time working around things that should *just work*

Ciao
Dustin Carter
 

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

Back
Top