Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am dying here...I am trying to add an event to a sheet module
I tested the code below which adds an open event to ThisWorkbook module and works great. "The CodeModule object has a method called CreateEventProc that you can use to create an event procedure in class module, a sheet" but i just cant figure how change the "ThisWorkbook" to a sheet moule Dim StartLine As Long With ActiveWorkbook.VBProject.VBComponents("ThisWorkboo k").CodeModule StartLine = .CreateEventProc("Open", "Workbook") + 1 .InsertLines StartLine, _ "Msgbox ""Hello World"",vbOkOnly" End With |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ByRef Cancel in event module | Excel Programming | |||
Calls from sheet module to ThisWorkbook module | Excel Programming | |||
Variable in event handles can't be used in module?? | Excel Programming | |||
Run module ON OPEN event?? | Excel Programming | |||
Variable from a sheet module in a class module in XL XP | Excel Programming |