|
3 | 3 | * See LICENSE in the project root for license information.
|
4 | 4 | */
|
5 | 5 |
|
6 |
| -import * as OfficeHelpers from '@microsoft/office-js-helpers'; |
| 6 | +import * as OfficeHelpers from "@microsoft/office-js-helpers"; |
7 | 7 |
|
8 | 8 | $(document).ready(() => {
|
9 |
| - $('#run').click(run); |
| 9 | + $("#run").click(run); |
10 | 10 | });
|
11 | 11 |
|
12 | 12 | // The initialize function must be run each time a new page is loaded
|
13 |
| -Office.initialize = (reason) => { |
14 |
| - $('#sideload-msg').hide(); |
15 |
| - $('#app-body').show(); |
| 13 | +Office.initialize = () => { |
| 14 | + $("#sideload-msg").hide(); |
| 15 | + $("#app-body").show(); |
16 | 16 | };
|
17 | 17 |
|
18 | 18 | async function run() {
|
19 | 19 | try {
|
20 |
| - await Excel.run(async context => { |
21 |
| - /** |
22 |
| - * Insert your Excel code here |
23 |
| - */ |
24 |
| - const range = context.workbook.getSelectedRange(); |
25 |
| - |
26 |
| - // Read the range address |
27 |
| - range.load('address'); |
28 |
| - |
29 |
| - // Update the fill color |
30 |
| - range.format.fill.color = 'yellow'; |
31 |
| - |
32 |
| - await context.sync(); |
33 |
| - console.log(`The range address was ${range.address}.`); |
34 |
| - }); |
35 |
| - } catch(error) { |
36 |
| - OfficeHelpers.UI.notify(error); |
37 |
| - OfficeHelpers.Utilities.log(error); |
38 |
| - }; |
| 20 | + await Excel.run(async context => { |
| 21 | + /** |
| 22 | + * Insert your Excel code here |
| 23 | + */ |
| 24 | + const range = context.workbook.getSelectedRange(); |
| 25 | + |
| 26 | + // Read the range address |
| 27 | + range.load("address"); |
| 28 | + |
| 29 | + // Update the fill color |
| 30 | + range.format.fill.color = "yellow"; |
| 31 | + |
| 32 | + await context.sync(); |
| 33 | + console.log(`The range address was ${range.address}.`); |
| 34 | + }); |
| 35 | + } catch (error) { |
| 36 | + OfficeHelpers.UI.notify(error); |
| 37 | + OfficeHelpers.Utilities.log(error); |
| 38 | + } |
39 | 39 | }
|
40 |
| - |
0 commit comments