Build the client application.
- Start Excel.
- Use Tools/references of the VBA view to check in the server's tlb.
- Declare a TheCoClass variable using WithWEvents keyword.
- Catch a double click event in the spreadsheet module
and include a call to mainAction.
- Implement the action() function
- Observe that action() is called everytime the mainAction is called.
Dim WithEvents server As CALLBACKSERVERLib.TheCoClass
Dim c As Range
Private Sub server_action()
c.Value = 666
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Set c = Target
If server Is Nothing Then
Set server = New CALLBACKSERVERLib.TheCoClass
End If
server.mainMethod
End Sub