I would appreciate your kind help:
I am trying to write a script in google sheet in order to move a drawing (over cells) to a specific location. I tried this method on my google sheet and it didn't work: In Google Sheets how can I write a script to move each drawing to a specific location on the sheet?
Do you have any idea why? Thank you all in advance!
The code I've tried:
const obj = {
"10": {name: " Drawing1 ", moveTo: [1,1]},
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("sheet1");
sheet.getDrawings().forEach(d => {
const arow = d.getContainerInfo().getAnchorRow();
if (arow in obj) {
d.setPosition(...obj[arow].moveTo, 0, 0);
}
})