Last active
May 16, 2017 18:27
-
-
Save Zlatkovsky/c61594f1c86970e8dba91fe94b7ca4b6 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: '(StackOverflow 44001819): Worksheet positions' | |
description: '' | |
author: Zlatkovsky | |
host: EXCEL | |
api_set: {} | |
script: | |
content: | | |
$("#run").click(run); | |
function run() { | |
Excel.run(function(ctx) { | |
var wSheetName = 'Sheet1'; | |
var wSheetName2 = 'Sheet2'; | |
var worksheet = ctx.workbook.worksheets.getItem(wSheetName); | |
var worksheet2 = ctx.workbook.worksheets.getItem(wSheetName2); | |
worksheet.load('name, position') | |
worksheet2.load('name, position') | |
return ctx.sync().then(function () { | |
console.log(worksheet.name + ": " + worksheet.position); | |
console.log(worksheet2.name + ": " + worksheet2.position); | |
}); | |
}).catch(function(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