Created
May 17, 2017 13:25
-
-
Save jkpieterse/cfa9152cf4be2494e7e0af9241cae7b7 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: Blank snippet | |
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 | |
office-ui-fabric-js@1.4.0/dist/css/fabric.min.css | |
office-ui-fabric-js@1.4.0/dist/css/fabric.components.min.css | |
# NPM libraries | |
core-js@2.4.1/client/core.min.js | |
@microsoft/office-js-helpers@0.7.1/dist/office.helpers.min.js | |
jquery@3.1.1 | |
# IntelliSense: @types/library or node_modules paths or URL to d.ts files | |
@types/office-js | |
@types/core-js | |
@microsoft/office-js-helpers@0.7.1/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