BeforeKeyPress Event

Microsoft Office Web Components Visual Basic

Private Sub Object_BeforeKeyPress(ByVal KeyAscii As Long, ByVal Cancel As ByRef)

Object    A ChartSpace , PivotTable , or Spreadsheet object.

KeyAscii    An integer that represents the key code of the key that was pressed or released.

Cancel     Set the Value property of this object to True to cancel the keystroke.

Remarks

Canceling this event does not prevent the KeyPress or KeyUp events from firing.

The sequence of keyboard-related events is:

  1. BeforeKeyDown
  2. KeyDown
  3. BeforeKeyPress
  4. KeyPress
  5. BeforeKeyUp
  6. KeyUp