Spreadsheet.RunEvent

This function runs the event.

Syntax Parameters Return Value
- This function has no parameters. This function does not return a value.

SVB Example

Adding and running document-level event code in a spreadsheet:

Option Base 1
Option Explicit
Sub Main
    Dim spr As Spreadsheet
    Set spr = Spreadsheets(1)
    'insert a function into the spreadsheet that will
    'display a message box whenever it 
    'is activated
    spr.EventCode = _
        "Private Sub Document_Activate()" & vbCrLf & _
        "MsgBox(""Spreadsheet now activated"",vbExclamation)" & _
        vbCrLf & "End Sub"
    spr.RunEvent()
End Sub