# Revision history [back]

I had an epiphany of sorts, and inserted an argument into the Sub statement. That argument refers to an object containing enough information to satisfy my requirement.

I had an epiphany of sorts, and inserted an argument into the Sub statement. That argument refers to an object containing enough information to satisfy my requirement.

Edit: The pertinent macro statements for me are:

Sub ButtonClicked (ref As Object)
text = ref.Source.AccessibleContext.Text
End Sub


Set an appropriate breakpoint and a watch on ref, then click the button; you can then see what other parameters than Text are available. Additional code is necessary to create a useful macro. Different requirements make it impossible to be specific about what is useful in other situatiions.

This is for buttons on a calc sheet, not buttons in a dialog. The macro must be connected to the button in the Events tab of the button properties dialog; see LibreOffice help for instructions.