当指定的数据透视图视图中任意对象被提交之前,该事件会发生。
Private Sub Form_BeforeRender(ByVal drawObject As Object, ByVal chartObject As Object, ByVal Cancel As Object)
drawObject 对 ChChartDraw 对象的引用。使用返回对象的 DrawType 属性可以决定即将发生哪种类型的提交。
chartObject 即将提交的对象。使用 TypeName 函数确定对象的类型。
Cancel 将该对象的 Value 属性设为 True 可取消“数据透视图视图”对象的提交。
下面的示例显示了捕获 BeforeRender 事件的子例程的语法。
Private Sub Form_BeforeRender( _
ByVal drawObject As Object, _
ByVal chartObject As Object, _
ByVal Cancel As Object)
Dim intResponse As Integer
Dim strPrompt As String
strPrompt = "Cancel render of current object?"
intResponse = MsgBox(strPrompt, vbYesNo)
If intResponse = vbYes Then
Cancel.Value = True
Else
Cancel.Value = False
End If
End Sub