Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Keep VBA window hidden

JGeniti wrote:
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



Sceen updating works only on Excel windows.
You can't hide VBE windows, but you can freeze it.



Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock
As Long) As Long



ActiveWorkbook.VBProject.VBE.MainWindow.SetFocus
LockWindowUpdate Application.VBE.MainWindow.Hwnd


your code


Application.VBE.MainWindow.Visible = False

LockWindowUpdate 0&
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
View cell contents as a pop-up window (similar to comments window) Oldersox Excel Worksheet Functions 1 February 6th 08 07:09 AM
Template opens in hidden window? ktlasers Excel Discussion (Misc queries) 0 October 4th 07 09:30 PM
The window opens in a smaller window not full sized window. Rachael Excel Discussion (Misc queries) 0 November 7th 06 09:04 PM
make hidden window or workbook visible without specify the name mango Excel Worksheet Functions 1 December 30th 04 03:05 PM
unhide hidden window or workbook mango Excel Worksheet Functions 1 December 21st 04 09:59 AM


All times are GMT +1. The time now is 12:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"