Instantly share code, notes, and snippets.

Embed
What would you like to do?
Einfaches Beispielscript zur Übersetzung einer Formel in Englisch - Shared with Script Lab
name: Formel in English
description: Einfaches Beispielscript zur Übersetzung einer Formel in Englisch
author: maninweb
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(run);
async function run() {
try {
await Excel.run(async (context) => {
// Bereichsauswahl...
let Range = context.workbook.getSelectedRange();
// Laden der Eigenschaften...
Range.load("formulas, formulasLocal");
// Synchonisation...
await context.sync();
// Ausgabe...
$("#formel-original").text(Range.formulasLocal[0][0]);
$("#formel-englisch").text(Range.formulas[0][0]);
});
}
catch (error) {
OfficeHelpers.Utilities.log(error);
}
}
language: typescript
template:
content: |
<button id="run" class="ms-Button">
<span class="ms-Button-label">Run</span>
</button>
<div id="formel-original" class="anzeigefeld"></div>
<div id="formel-englisch" class="anzeigefeld"></div>
language: html
style:
content: "\r\n.anzeigefeld {\r\n min-height: 20px;\r\n width: 100%;\r\n border: 1px solid #eaeaea;\r\n margin: 10px 0;\r\n padding: 5px 0;\r\n font-size: 0.9em;\r\n text-align: left;\r\n}\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.6.0/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/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