I want to use this macro in LibreOffice Calc spreadsheet but instead get “Button Name”
I what to get “Button Label”.
Can anyone help me change this code? Thank you
def insert_button_name(oEvent):
"""Insert the button name into the next empty row in column E.
Update B2 to track the next available row number.
"""
oButton = oEvent.Source
button_name = oButton.getModel().getName()
oDoc = XSCRIPTCONTEXT.getDocument()
oSheet = oDoc.getCurrentController().getActiveSheet()
oCell = oSheet.getCellRangeByName("B2")
COLUMN_E = 4
row_num = oCell.getValue() - 1
oTargetCell = oSheet.getCellByPosition(COLUMN_E, id)
oTargetCell.setString(button_name)
oCell.setValue(oCell.getValue() + 1)
I what to get “Button Label”.
Can anyone help me change this code? Thank you
def insert_button_name(oEvent):
"""Insert the button name into the next empty row in column E.
Update B2 to track the next available row number.
"""
oButton = oEvent.Source
button_name = oButton.getModel().getName()
oDoc = XSCRIPTCONTEXT.getDocument()
oSheet = oDoc.getCurrentController().getActiveSheet()
oCell = oSheet.getCellRangeByName("B2")
COLUMN_E = 4
row_num = oCell.getValue() - 1
oTargetCell = oSheet.getCellByPosition(COLUMN_E, id)
oTargetCell.setString(button_name)
oCell.setValue(oCell.getValue() + 1)