EventInfo.Cancel property (Project)
In an event handler, the Cancel property gets or sets a value that specifies whether the operation that triggered the event should continue. If True, the operation is canceled. Read/write Boolean.
Syntax
expression. Cancel
expression A variable that represents an EventInfo object.
Remarks
The default value of the Cancel property is False when an event occurs. Set Cancel to True to cancel an operation.
Example
The following event handler examines new resource assignments and cancels them if they are for the specified resource.
Private Sub App_ProjectBeforeAssignmentChange2(ByVal asg As Assignment, ByVal Field As PjAssignmentField, _
ByVal NewVal As Variant, EventInfo As Object)
If Field = pjAssignmentResourceName And NewVal = "Lisa Jones" Then
MsgBox "Lisa is no longer available for assignment!"
EventInfo.Cancel = True
End If
End Sub
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for