Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
avoiding VBEopen when using CreateEventProc:AGAIN
Sorry folks, need to come back to the experts again on this.
The suggestion received was that using Application.VBE.MainWindow.visible = False would prevent the VBE from becoming visible when writing an event into a Sheet Module using CreateEventProc. The immediate window certainly shows this turns visibility off, but calling my method with the CreateEventProc code apparently turns visibility back ON! (see below) code snippet is Application.VBE.MainWindow.visible = False Debug.Print "Application.VBE.MainWindow.visible(1)?: " & Application.VBE.MainWindow.visible Call commonFunctions.insertSelectionChange(wkbNew) Debug.Print "Application.VBE.MainWindow.visible(2)?: " & Application.VBE.MainWindow.visible resulting immediate window is Application.VBE.MainWindow.visible(1): False Application.VBE.MainWindow.visible(2): True The insertSelectionChange function is Function insertSelectionChange(wkbNew As Workbook) Dim startPoint As Long With wkbNew.VBProject.VBComponents("sheet2").CodeModule startPoint = .CreateEventProc("selectionChange", "worksheet") + 1 ..InsertLines startPoint, "'Application.ScreenUpdating = true" & Chr(13) & _ -- BULK CODE CUT HERE -- " If selection.Row = 1 Or _" & Chr(13) & _ " End If" End With End Function Suggestions gratefully received Matthew |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
avoiding VBEopen when using CreateEventProc | Excel Programming | |||
Excel crashes when using CreateEventProc towards CodeModule | Excel Programming | |||
CreateEventProc for OLE button crashes Excel | Excel Programming | |||
Using CreateEventProc fails when used with a Worksheet. | Excel Programming | |||
Excel crashes with createEventProc for a button | Excel Programming |