For some reason the macro doesn't work

function IncreaseValue() {
var selectedCells = onlyOfficeTable.getSelectedCells(); // Method to get selected cells

 for (var i = 0; i < selectedCells.length; i++) {
     var currentCell = selectedCells[i];
     var currentValue = currentCell.getValue();
     currentCell.setValue(currentValue + 1);
 }

}

// Function call
IncreaseValue();

Hello @Nikita18

This example does not seem to rely on methods of our API. Please see this page to find out more information about macros in ONLYOFFICE Docs: https://api.onlyoffice.com/plugin/macros

Basically, you have to follow the scripting notation of Document Builder when writing down the macros.