David,
I got your email. I don't really code VBA but I will give it a shot here.
A Workbook consists of worksheet objects which consists of cell objects. A mouse click event such as the following:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MsgBox "You just changed " & Target.Address
End Sub
...occurs at the worksheet level. Why? Because a cell is part of the worksheet. You could probably wire an event handler that would bubble it up but I am a C# guy and not a VBA person. In C# we could write a delegate to achieve this result.
The ExcelXP tagset is going to simply generate XML. The easiest way to determine what should be there is to write the code in Excel, save the workbook as an XML workbook, then determine what was reflected in the XML for the VBA code. I would then gen the worksheet in XML, read it back in, and insert the needed macro code in its place.
The above is an educated stab at the issue but I hope it helped a bit.
Hi Cynthia!
Alan Churchill
https://github.com/savian-net