your help on event handling
===

I am learning event handling of vba. here is my first try out. 

    'in sheet Object
    Dim WithEvents engine As MCengine

    Private Sub engine_OnEachTrial(ByVal i As Integer)
    progressBar = Application.Floor(i * 30 / engine.numOfPaths, 0.001)
    
    With ActiveSheet.Range("E10").Characters(start:=0, Length:=progressBar).Font
        .Name = "Calibri"
        .FontStyle = "Bold"
        .Size = 11
        .ColorIndex = 16
    End With
    End Sub

    Private Sub Worksheet_Activate()

    Dim btn As Button
    Dim rng As Range
    Set engine = New MCengine
    With ActiveSheet
    Set rng = .Range("E9")
    Set btn = .Buttons.Add(rng.Left, rng.Top, rng.Width, rng.Height)
        With btn
        .Caption = "Run MC simulation"
        .OnAction = "runMC"
        End With
    End With
    
    End Sub

    Sub runMC()
  
    engine.process = 1
    engine.numOfPaths = 30
    engine.start
    
    End Sub

The problem with above code is sub procedure registered by onAction cannot be called because it looks like runMC has to be in Module. I cannot move these code to module because `Dim WithEvents engine As MCengine` requires to be declared in sheet object. so I am stuck in the middle. should I use other button callback method?

Does it mean I cannot use class with events in module? anyone can enlighten me?