Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tim; your code looks perfect, but doesn't work across when the classes
are in two vba projects. When the following below code in classB, which is in efBasicAppFrameworkLibrary that holds a reference to efBasicVbaLibrary, it gets a runtime error on New efBasicVbaLibrary.CMsgEx: Private Sub Class_Initialize() Set m_oMsgEx = New efBasicVbaLibrary.CMsgEx End Sub Thanks, Eric "Tim Williams" wrote: OK - this is what I used... '#### test code Sub Tester() Dim oB As clsB Set oB = New clsB oB.SubClassA.DisplayConsumerInformation End Sub '############### clsA code Option Explicit Private m_title As String Public Event appTitleRequest(ByRef MsgEx As clsA) Public Sub DisplayConsumerInformation() Me.Title="" RaiseEvent appTitleRequest(Me) MsgBox Me.Title End Sub Property Let Title(sTitle As String) m_title = sTitle End Property Property Get Title() As String Title = m_title End Property '##################### clsB code Public WithEvents m_oMsgEx As clsA Private Sub Class_Initialize() Set m_oMsgEx = New clsA End Sub Private Sub m_oMsgEx_AppTitleRequest(MsgEx As clsA) MsgEx.Title = Me.AppName End Sub Property Get AppName() As String AppName = "Some App Name" End Property Property Get SubClassA() As clsA Set SubClassA = m_oMsgEx End Property "Tim Williams" wrote in message oups.com... Sorry - paste error. The clsB code is wrong. Will repost when I get home... Tim |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA projects!! Aaaargh! | Excel Programming | |||
help with projects | Excel Discussion (Misc queries) | |||
vba events across projects? | Excel Programming | |||
How to become a better programmer, post college. More projects or less projects. | Excel Programming | |||
locked vb projects | Excel Programming |