Created
May 17, 2017 14:01
-
-
Save jkpieterse/5c89ffde829ec29e754cb8bf335267e3 to your computer and use it in GitHub Desktop.
Shared with Script Lab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Mutliply range with 5 | |
description: '' | |
author: jkpieterse | |
host: EXCEL | |
api_set: {} | |
script: | |
content: | | |
$("#run").click(run); | |
async function run() { | |
try { | |
await Excel.run(async (context) => { | |
var i = 0; | |
var j = 0; | |
var sht = context.workbook.worksheets.getActiveWorksheet(); | |
await context.sync(); | |
var rng = sht.getRange("B1:K11"); | |
await context.sync(); | |
context.load(rng,"values"); | |
await context.sync(); | |
var results = rng.values; | |
for (i = 0; i < results.length; i++) | |
{ | |
for (j = 0; j < results[i].length; j++) | |
{ | |
results[i][j] = results[i][j] * 5; | |
}; | |
}; | |
sht.getRange("B14:K24").values = results; | |
await context.sync(); | |
}); | |
} | |
catch (error) { | |
OfficeHelpers.UI.notify(error); | |
OfficeHelpers.Utilities.log(error); | |
} | |
} | |
language: typescript | |
template: | |
content: | | |
<button id="run" class="ms-Button"> | |
<span class="ms-Button-label">Run</span> | |
</button> | |
language: html | |
style: | |
content: "/* Your style goes here */\r\n" | |
language: css | |
libraries: | | |
# Office.js | |
https://appsforoffice.microsoft.com/lib/1/hosted/office.js | |
# CSS Libraries | |
[email protected]/dist/css/fabric.min.css | |
[email protected]/dist/css/fabric.components.min.css | |
# NPM libraries | |
[email protected]/client/core.min.js | |
@microsoft/[email protected]/dist/office.helpers.min.js | |
[email protected] | |
# IntelliSense: @types/library or node_modules paths or URL to d.ts files | |
@types/office-js | |
@types/core-js | |
@microsoft/[email protected]/dist/office.helpers.d.ts | |
@types/jquery |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment