You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/excel-tutorial.md
+109-4Lines changed: 109 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,11 @@ In this tutorial, you'll create an Excel task pane add-in that:
40
40
41
41

42
42
43
+
Next, select the type of manifest that you'd like to use, either the **unified manifest for Microsoft 365** or the **add-in only manifest**. Most of the steps in this tutorial are the same regardless of the manifest type, but the [Protect a worksheet](#protect-a-worksheet) section has separate steps for each manifest type.
44
+
45
+
> [!NOTE]
46
+
> Using the unified manifest for Microsoft 365 with Excel add-ins is in public developer preview. The unified manifest for Microsoft 365 shouldn't be used in production Excel add-ins. We invite you to try it out in test or development environments. For more information, see the [Public developer preview app manifest schema](/microsoftteams/platform/resources/schema/manifest-schema-dev-preview).
47
+
43
48
After you complete the wizard, the generator creates the project and installs supporting Node components. You may need to manually run `npm install` in the root folder of your project if something fails during the initial setup.
44
49
45
50
## Create a table
@@ -475,16 +480,114 @@ In this step of the tutorial, you'll add a button to the ribbon that toggles wor
475
480
476
481
### Configure the manifest to add a second ribbon button
477
482
478
-
There are two manifest options for Office Add-ins: the unified manifest for Microsoft 365, and the add-in only manifest.
483
+
The steps vary depending on the type of manifest.
479
484
480
-
# [Unified manifest for Microsoft 365](#tab/jsonmanifest)
485
+
# [Unified manifest for Microsoft 365 (preview)](#tab/jsonmanifest)
481
486
482
487
> [!NOTE]
483
-
> The unified manifest for Microsoft 365 is currently in public developer preview for Excel and shouldn't be used in production Excel add-ins. We invite you to try it out in test or development environments. Use the add-in only manifest for production Excel add-ins.
488
+
> Using the unified manifest for Microsoft 365 with Excel add-ins is in public developer preview. The unified manifest for Microsoft 365 shouldn't be used in production Excel add-ins. We invite you to try it out in test or development environments. For more information, see the [Public developer preview app manifest schema](/microsoftteams/platform/resources/schema/manifest-schema-dev-preview).
489
+
490
+
#### Configure the runtime for the ribbon button
484
491
485
492
1. Open the manifest file **./manifest.json**.
486
493
487
-
1. (More steps TBD)
494
+
1. Find the **"extensions.runtimes"** array and add the following commands runtime object.
495
+
496
+
```json
497
+
"runtimes": [
498
+
{
499
+
"id": "CommandsRuntime",
500
+
"type": "general",
501
+
"code": {
502
+
"page": "https://localhost:3000/commands.html"
503
+
},
504
+
"lifetime": "short",
505
+
"actions": [
506
+
{
507
+
"id": <!--TODO1: Set the action ID -->,
508
+
"type": "executeFunction",
509
+
}
510
+
]
511
+
}
512
+
]
513
+
```
514
+
515
+
1. Find `TODO1` and replace it with **"toggleProtection"**. This matches the `id` for the JavaScript function you create in a later step.
516
+
517
+
> [!TIP]
518
+
> The value of **"actions.id"** must match the first parameter of the call to `Office.actions.associate` in your **commands.js** file.
519
+
520
+
1. Ensure that the **"requirements.capabilities"** array contains an object that specifies the **"AddinCommands"** requirement set with a **"minVersion"** of **"1.1"**.
521
+
522
+
```json
523
+
"requirements": {
524
+
"capabilities": [
525
+
{
526
+
"name": "AddinCommands",
527
+
"minVersion": "1.1"
528
+
}
529
+
]
530
+
},
531
+
```
532
+
533
+
#### Configure the UI for the ribbon button
534
+
535
+
1. After the **"extensions.runtimes"** array, add the following **"ribbons"** array.
"description": "Enables or disables worksheet protection."
572
+
},
573
+
"actionId": <!--TODO3: Set the action ID -->
574
+
}
575
+
]
576
+
}
577
+
]
578
+
}
579
+
]
580
+
}
581
+
]
582
+
```
583
+
584
+
1. Find `TODO1` and replace it with **"TabHome"**. This ensures that the new button displays in the Home tab in Excel. For other available tab IDs, see [Find the IDs of built-in Office ribbon tabs](/develop/built-in-ui-ids.md).
585
+
586
+
1. Find `TODO2` and replace it with **"Toggle worksheet protection"**. This is the label for your button in the Excel ribbon.
587
+
588
+
1. Find `TODO3` and replace it with **"toggleProtection"**. This value must match the **"runtimes.actions.id"** value.
589
+
590
+
1. Save the file.
488
591
489
592
# [Add-in only manifest](#tab/xmlmanifest)
490
593
@@ -582,6 +685,8 @@ There are two manifest options for Office Add-ins: the unified manifest for Micr
0 commit comments