on 03-17-2021 3:55 AM
Hi,
I have a workbook with the following VBA code.
Function AFTER_WORKBOOK_OPEN()
MsgBox "On Open"
End Function
Function BEFORE_CONTEXTCHANGE()
MsgBox "Before Context Change"
End Function
Function AFTER_CONTEXTCHANGE()
MsgBox "After Context Change"
End Function
and the sheet has a button with the following
=@EPMContextMember(,"DEPARTMENT")
When I change the context, the Before_ContextChange message displays but the After_ContextChange message does not display. If I remove the After_Workbook_Open, the After_ContextChange message displays fine. Can someone offer a suggestion as to the cause?
Thanks
Cliff
Don't use MsgBox if you want to look on event sequence,
Use log with the shape TextBox:
Function AFTER_WORKBOOK_OPEN()
ThisWorkbook.Worksheets("Sheet1").Shapes("TextBox 1").TextFrame.Characters.Text = _
ThisWorkbook.Worksheets("Sheet1").Shapes("TextBox 1").TextFrame.Characters.Text & "On Open" & vbCrLf
End Function
Function BEFORE_CONTEXTCHANGE()
ThisWorkbook.Worksheets("Sheet1").Shapes("TextBox 1").TextFrame.Characters.Text = _
ThisWorkbook.Worksheets("Sheet1").Shapes("TextBox 1").TextFrame.Characters.Text & "Before Context Change" & vbCrLf
End Function
Function AFTER_CONTEXTCHANGE()
ThisWorkbook.Worksheets("Sheet1").Shapes("TextBox 1").TextFrame.Characters.Text = _
ThisWorkbook.Worksheets("Sheet1").Shapes("TextBox 1").TextFrame.Characters.Text & "After Context Change" & vbCrLf
End Function
TextBox 1 - shape inserted in Sheet1
Result (in TextBox 1):
Before Context Change
After Context Change
when I change context using:
=EPMContextMember(,"TIME")
P.S. By the way, if you change context directly, selecting member in EPM Context - then ONLY "After Context Change" event is generated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.