Snippets - Add-ins



Excel.run ( async (context) => { 
    let sheet1 = context.workbook.worksheets.getActiveWorksheet();
    let range1 = sheet1.getRange("A1:B6");
    let mynumbers = [ [5, 10], [15, 20], [25, 30], [35, 40], [45, 50], [55, 60] ];
    range1.values = mynumbers;
    let range2 = sheet1.getRange("A1:B2");
    range2.load('values');
    let range3 = await context.sync(range2);

    let cellvalue1 = range3.values[0][0];
    console.log(cellvalue1);
    let range4 = sheet.getRange("A3:B4");
    range4.load('values');
    let range5 = await context.sync(range4);

    let cellvalue2 = range5.values[0][0];
    console.log(cellvalue2);
    let range6 = sheet1.getRange("A5:B6");
    range6.load('values');
    let range7 = await context.sync(range6);

    let cellvalue3 = range7.values[0][0];
    console.log(cellvalue3);
    await context.sync();
}).then( () => { console.log("Finished");
}).catch( (error) => { console.log(error);
});



© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited TopPrevNext