3
votes

I had two similar applications that stopped functioning correctly. Both use the method, 'getRowIndex' and will no longer populate a variable for the position of my cursor with the active row positions. Has anyone experienced this? It looks like Google changed the way the getRowIndex function works within Google Apps Script. Any help with this is greatly appreciated. Below is a copy of my code where the problem is occurring.

var sheet1 = SpreadsheetApp.getActiveSheet();
var row1 = sheet1.getActiveRange().getRowIndex();

In the above example row1 always takes the value of 1 as if the cursor is on the first row which is not the case.

Thank you in advace for you time to help with this. Jeff

2

2 Answers

1
votes

There has been an issue with this some time ago but it is fixed... You can try this test sheet and see if it works with you (see 2 test functions in menu). If not (which is unlikely to happen) you can raise an issue in the issue tracker.

0
votes

Just tried running your snippet only adding the line Browser.msgBox(row1); and wrapping in a function which is running behind the button in this spreadsheet and getRowIndex() is working.