Skip to content

Commit 0e03fa7

Browse files
authored
Merge pull request #669 from OfficeDev/main
[admin] Publish
2 parents 8f9a2e5 + 871ef2f commit 0e03fa7

24 files changed

+137
-63
lines changed

docs/develop/macros-power-automate.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
---
22
title: Use macro-enabled files in Power Automate flows
33
description: Learn how to use macro-enabled files, or .xlsm files, in Power Automate flows.
4-
ms.date: 08/09/2023
4+
ms.date: 10/19/2023
55
ms.localizationpriority: medium
66
---
77

88
# How to use macro-enabled files in Power Automate flows
99

10-
You can integrate your .xlsm files with a Power Automate flow. This lets you start to convert your existing automation solutions to web-based formats. Please note that the macros contained in the .xlsm files cannot be run through Power Automate. Only Office Scripts are enabled there.
10+
[Power Automate](https://make.powerautomate.com/) flows support .xlsm files in the [Excel Online (Business) connector](https://make.powerautomate.com/connectors/shared_excelonlinebusiness/excel-online-business/).
1111

12-
The [Excel Online (Business) connector](https://make.powerautomate.com/connectors/shared_excelonlinebusiness/excel-online-business/) in [Power Automate](https://make.powerautomate.com/) is typically limited to files in the Microsoft Excel Open XML Spreadsheet (.xlsx) format. Its file browser only lets you select .xlsx files. However, macro-enabled files are compatible with the connector's **Run script** action if the file metadata is used.
12+
> [!IMPORTANT]
13+
> The macros contained in the .xlsm files cannot be run through Power Automate. Only Office Scripts are enabled there.
1314
14-
In your flow, use the **Get File Metadata** action from either the [OneDrive for Business](https://make.powerautomate.com/connectors/shared_onedriveforbusiness/onedrive-for-business/) or [SharePoint](https://make.powerautomate.com/connectors/shared_sharepointonline/sharepoint/) connectors. The **Run script** action accepts this metadata as a valid file. Use the *ID* dynamic content returned from the **Get file metadata** action as the "File" argument when running the script. The following screenshot shows a flow providing the metadata for a file called "Test Macro File.xlsm" to a **Run script** action.
15-
16-
:::image type="content" source="../images/xlsm-in-power-automate.png" alt-text="A flow with a Get file metadata action passing the metadata of a macro file to a Run script action.":::
15+
The **Run script** action lets you select .xlsm files. Other connector actions require you use the file ID. Get this ID with the **Get File Metadata** action from either the [OneDrive for Business](https://make.powerautomate.com/connectors/shared_onedriveforbusiness/onedrive-for-business/) or [SharePoint](https://make.powerautomate.com/connectors/shared_sharepointonline/sharepoint/) connectors. Use the *ID* dynamic content returned from the **Get file metadata** action as the "File" argument for Excel connector actions.
1716

1817
> [!WARNING]
1918
> Some .xlsm files, especially those with ActiveX or Form controls, may not work in the Excel online connector. Be sure to test before deploying your solution.
2019
21-
## Other resources
20+
## See also
2221

23-
[Watch Sudhi Ramamurthy's YouTube video on how use an .xlsm file in a Run Script action](https://youtu.be/o-H9BbywJQQ).
22+
- [Excel Online (Business) connector reference](/connectors/excelonlinebusiness/)
23+
- [Run Office Scripts with Power Automate](power-automate-integration.md)

docs/develop/pivottables.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Work with PivotTables in Office Scripts
33
description: Learn about the object model for PivotTables in the Office Scripts JavaScript API.
4-
ms.date: 09/08/2023
4+
ms.date: 10/19/2023
55
ms.localizationpriority: medium
66
---
77

@@ -26,7 +26,10 @@ The [PivotTable](/javascript/api/office-scripts/excelscript/excelscript.pivottab
2626
- The [PivotLayout](/javascript/api/office-scripts/excelscript/excelscript.pivotlayout) defines how the [PivotFields](/javascript/api/office-scripts/excelscript/excelscript.pivotfield) and [PivotItems](/javascript/api/office-scripts/excelscript/excelscript.pivotitem) are displayed.
2727
- [PivotFilters](/javascript/api/office-scripts/excelscript/excelscript.pivotfilters) filter data from the [PivotTable](/javascript/api/office-scripts/excelscript/excelscript.pivottable) using different criteria.
2828

29-
Look at how these relationships work in practice. The following data describes fruit sales from various farms. It's the base for all the examples in this article. Use [pivottable-sample.xlsx](pivottable-sample.xlsx) to follow along.
29+
To look at how these relationships work in practice, start by downloading the sample workbook. That data describes fruit sales from various farms. It's the base for all the examples in this article. Run the sample scripts throughout the article to create and explore PivotTables.
30+
31+
> [!div class="nextstepaction"]
32+
> [Download the sample workbook](pivottable-sample.xlsx)
3033
3134
:::image type="content" source="../images/pivottable-raw-data.png" alt-text="A collection of fruit sales of different types from different farms.":::
3235

docs/develop/script-buttons.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Run Office Scripts in Excel with buttons
2+
title: Run Office Scripts in Excel from buttons
33
description: Add buttons to workbooks that control Office Scripts in Excel.
44
ms.topic: overview
5-
ms.date: 03/10/2023
5+
ms.date: 10/24/2023
66
ms.localizationpriority: medium
77
---
88

9-
# Run Office Scripts in Excel with buttons
9+
# Run Office Scripts in Excel from buttons
1010

1111
Help your colleagues find and run your scripts by adding script buttons to a workbook.
1212

docs/develop/scripting-fundamentals.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
title: Fundamentals for Office Scripts in Excel
33
description: Object model information and other basics to learn before writing Office Scripts.
44
ms.topic: get-started
5-
ms.date: 10/01/2022
5+
ms.date: 10/24/2023
66
ms.localizationpriority: high
77
---
88

99
# Fundamentals for Office Scripts in Excel
1010

1111
This article will introduce you to the technical aspects of Office Scripts. You'll learn the critical parts of the TypeScript-based script code and how the Excel objects and APIs work together.
1212

13+
If you would prefer to get started with an interactive experience, try the tutorial [Record, edit, and create Office Scripts in Excel](../tutorials/excel-tutorial.md) or visit our [samples](../resources/samples/samples-overview.md).
14+
1315
## TypeScript: The language of Office Scripts
1416

1517
Office Scripts are written in [TypeScript](https://www.typescriptlang.org/docs/home.html), which is a superset of [JavaScript](https://developer.mozilla.org/docs/Web/JavaScript). If you're familiar with JavaScript, your knowledge will carry over because much of the code is the same in both languages. We recommend you have some beginner-level programming knowledge before starting your Office Scripts coding journey. The following resources can help you understand the coding side of Office Scripts.
@@ -41,6 +43,8 @@ To write a script, you need to understand how the Office Scripts APIs fit togeth
4143
- A **Worksheet** contains collections of those data objects that are present in the individual sheet.
4244
- **Workbooks** contain collections of some of those data objects (such as **Tables**) for the entire **Workbook**.
4345

46+
The complete list of Office Scripts API objects is detailed in the [ExcelScript package](/javascript/api/office-scripts/excelscript).
47+
4448
## Workbook
4549

4650
Every script is provided a `workbook` object of type `Workbook` by the `main` function. This represents the top level object through which your script interacts with the Excel workbook.
-50.4 KB
Binary file not shown.
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
Before starting this tutorial, you'll need access to the following:
2-
3-
- [Power Automate](/power-automate/organization-q-and-a).
4-
- Excel for Windows, for Mac, or on the web.
5-
- [A Microsoft 365 commercial or EDU plan that includes Office Scripts](/microsoft-365/admin/manage/manage-office-scripts-settings).
1+
You'll need access to Office Scripts and Power Automate for this tutorial. Please review the [Platform support](/office/dev/scripts/testing/platform-limits#platform-support) if the Automate tab doesn't appear. The [Power Automate sign-up FAQ](/power-automate/organization-q-and-a) has information on getting started with Power Automate.
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
Before starting this tutorial, you'll need access to Office Scripts, which requires the following:
2-
3-
- Excel for Windows, for Mac, or on the web.
4-
- [A Microsoft 365 commercial or EDU plan that includes Office Scripts](/microsoft-365/admin/manage/manage-office-scripts-settings).
1+
You'll need access to Office Scripts for this tutorial. Please review the [Platform support](/office/dev/scripts/testing/platform-limits#platform-support) if the Automate tab doesn't appear.

docs/resources/samples/add-excel-comments.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Add comments in Excel
33
description: Learn how to use Office Scripts to add comments in a worksheet.
4-
ms.date: 08/14/2023
4+
ms.date: 10/20/2023
55
ms.localizationpriority: medium
66
---
77

@@ -11,22 +11,25 @@ This sample shows how to add comments to a cell including [@mentioning](https://
1111

1212
## Example scenario
1313

14-
* The team lead maintains the shift schedule. The team lead assigns an employee ID to the shift record.
15-
* The team lead wishes to notify the employee. By adding a comment that @mentions the employee, the employee is emailed with a custom message from the worksheet.
16-
* Subsequently, the employee can view the workbook and respond to the comment at their convenience.
14+
The team lead maintains the shift schedule. They assign an employee ID to the shift record. If the team lead wishes to notify the employee, they add a comment that @mentions the employee. The employee is emailed with a custom message from the worksheet. Subsequently, the employee can view the workbook and respond to the comment at their convenience.
1715

1816
## Solution
1917

2018
1. The script extracts employee information from the employee worksheet.
2119
1. The script then adds a comment (including the relevant employee email) to the appropriate cell in the shift record.
2220
1. Existing comments in the cell are removed before adding the new comment.
2321

24-
## Sample Excel file
22+
## Setup: Sample Excel file
2523

26-
Download [add-excel-comments.xlsx](add-excel-comments.xlsx) for a ready-to-use workbook. Add the following script to try the sample yourself!
24+
This workbook contains the data, objects, and formatting expected by the script.
25+
26+
> [!div class="nextstepaction"]
27+
> [Download the sample workbook](add-excel-comments.xlsx)
2728
2829
## Sample code: Add comments
2930

31+
Add the following script to the sample workbook and try the sample yourself!
32+
3033
```TypeScript
3134
function main(workbook: ExcelScript.Workbook) {
3235
// Get the list of employees.

docs/resources/samples/add-image-to-workbook.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,17 @@ The first sample copies an image from one worksheet to another. This could be us
1717

1818
The second sample copies an image from a URL. This could be used to copy photos that a colleague stored in a shared folder to a related workbook. Please note that this sample can't be adapted to work with a local image file, as that isn't supported by Office Scripts.
1919

20-
## Sample Excel file
20+
## Setup: Sample Excel file
2121

22-
Download [add-images.xlsx](add-images.xlsx) for a ready-to-use workbook. Add the following scripts and try the sample yourself!
22+
This workbook contains the data, objects, and formatting expected by the script.
23+
24+
> [!div class="nextstepaction"]
25+
> [Download the sample workbook](add-images.xlsx)
2326
2427
## Sample code: Copy an image across worksheets
2528

29+
Add the following script to the sample workbook and try the sample yourself!
30+
2631
```TypeScript
2732
/**
2833
* This script transfers an image from one worksheet to another.

docs/resources/samples/community-seasons-greetings.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,16 @@ Enjoy!
1313

1414
[Watch the Seasons greetings script in action on the "Les's IT Blog" YouTube channel](https://youtu.be/HBiGEkzmkgo).
1515

16-
## Script
16+
## Setup: Sample Excel file
1717

18-
Download [happy-tree.xlsx](happy-tree.xlsx) for a ready-to-use workbook. Add the following script to try the sample yourself!
18+
This workbook contains the data, objects, and formatting expected by the script.
19+
20+
> [!div class="nextstepaction"]
21+
> [Download the sample workbook](happy-tree.xlsx)
22+
23+
## Sample code: Happy tree
24+
25+
Add the following script to the sample workbook and try the sample yourself!
1926

2027
```TypeScript
2128
/* Original version by Leslie Black. */

0 commit comments

Comments
 (0)