Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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
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
avoiding VBEopen when using CreateEventProc [email protected][_2_] Excel Programming 4 December 14th 04 05:40 PM
Excel crashes when using CreateEventProc towards CodeModule Bertil Emmertz Excel Programming 2 December 5th 04 10:35 AM
CreateEventProc for OLE button crashes Excel Jag Man Excel Programming 3 February 18th 04 11:25 PM
Using CreateEventProc fails when used with a Worksheet. George Doster Excel Programming 3 October 22nd 03 04:22 PM
Excel crashes with createEventProc for a button Tom Ogilvy Excel Programming 4 August 25th 03 08:30 PM


All times are GMT +1. The time now is 05:56 AM.

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"