-
Notifications
You must be signed in to change notification settings - Fork 270
[Excel] (Custom functions) Update low engagement articles #5364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alison-mk
wants to merge
12
commits into
main
Choose a base branch
from
alison-mk-fhl-low-engagement
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c45976c
[Excel] Update low engagement articles
alison-mk 74a42b6
Add custom functions naming updates
alison-mk ce1f207
Add custom functions batching updates
alison-mk f8cfe04
Add JS-only runtime updates
alison-mk 7caae51
Move data validation changes to different PR
alison-mk 95d521d
Move delay cell edit changes to another PR
alison-mk 232d4c8
Move special cells changes to another PR
alison-mk 4dd1c92
Move performance changes to another PR
alison-mk 55db14c
Remove duplicated line
alison-mk 2b391ef
Apply suggestions from code review
alison-mk 5f091fe
Reorganize article intro per feedback
alison-mk 853d2bb
Merge branch 'main' into alison-mk-fhl-low-engagement
alison-mk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"MD025": false, | ||
"MD033": { | ||
"allowed_elements": ["kbd"] | ||
} | ||
} |
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
--- | ||
title: Custom functions debugging in a non-shared runtime | ||
description: Learn how to debug your Excel custom functions that don't use a shared runtime. | ||
ms.date: 01/03/2024 | ||
description: Debug Excel custom functions that don't use a shared runtime. | ||
ms.date: 09/19/2025 | ||
ms.topic: troubleshooting | ||
ms.localizationpriority: medium | ||
--- | ||
|
||
# Custom functions debugging in a non-shared runtime | ||
|
||
This article discusses debugging only for custom functions that **don't use a [shared runtime](../testing/runtimes.md#shared-runtime)**. To debug custom functions add-ins that use a shared runtime, see [Overview of debugging Office Add-ins](../testing/debug-add-ins-overview.md). | ||
This article covers debugging only for custom functions that **don't use a [shared runtime](../testing/runtimes.md#shared-runtime)**. For shared runtime scenarios, see [Overview of debugging Office Add-ins](../testing/debug-add-ins-overview.md). | ||
|
||
[!include[Excel custom functions note](../includes/excel-custom-functions-note.md)] | ||
|
||
|
@@ -31,13 +31,13 @@ The process of debugging a custom function for add-ins that don't use a shared r | |
|
||
## Use the browser developer tools to debug custom functions in Excel on the web | ||
|
||
You can use the browser developer tools to debug custom functions that don't use a shared runtime in Excel on the web. The following steps work for both Windows and macOS. | ||
You can use the browser developer tools to debug custom functions that don't use a shared runtime in Excel on the web. The following steps work for Windows and macOS. | ||
|
||
### Run your add-in from Visual Studio Code | ||
|
||
1. Open your custom functions root project folder in [Visual Studio Code (VS Code)](https://code.visualstudio.com/). | ||
1. Choose **Terminal** > **Run Task** and type or select **Watch**. This will monitor and rebuild for any file changes. | ||
1. Choose **Terminal** > **Run Task** and type or select **Dev Server**. | ||
1. Choose **Terminal** > **Run Task** and run **Watch**. This will monitor and rebuild for any file changes. | ||
1. Choose **Terminal** > **Run Task** and run **Dev Server**. | ||
|
||
### Sideload your add-in | ||
|
||
|
@@ -54,18 +54,18 @@ You can use the browser developer tools to debug custom functions that don't use | |
|
||
### Start debugging | ||
|
||
1. Open developer tools in the browser. For Chrome and most browsers F12 will open the developer tools. | ||
1. Open developer tools in the browser. For Chrome and most browsers F12 opens the developer tools. | ||
1. In developer tools, open your source code script file using <kbd>Cmd</kbd>+<kbd>P</kbd> or <kbd>Ctrl</kbd>+<kbd>P</kbd> (**functions.js** or **functions.ts**). | ||
1. [Set a breakpoint](https://code.visualstudio.com/Docs/editor/debugging#_breakpoints) in the custom function source code. | ||
|
||
If you need to change the code you can make edits in VS Code and save the changes. Refresh the browser to see the changes loaded. | ||
If needed, edit code in VS Code, save, then refresh the workbook page to load updates. | ||
|
||
## Use the command line tools to debug | ||
|
||
If you aren't using VS Code, you can use the command line (such as bash, or PowerShell) to run your add-in. You'll need to use the browser developer tools to debug your code in Excel on the web. You cannot debug the desktop version of Excel using the command line. | ||
If you aren't using VS Code, you can use the command line such as bash or PowerShell to run your add-in. Use the browser developer tools to debug your code in Excel on the web. You cannot debug the desktop version of Excel from the command line. | ||
|
||
1. From the command line run `npm run watch` to watch for and rebuild when code changes occur. | ||
1. Open a second command line window (the first one will be blocked while running the watch.) | ||
1. Open a second command line window (the first one is busy while running the watch.) | ||
|
||
1. If you want to start your add-in in the desktop version of Excel and the "scripts" section of the project's package.json file has a "start:desktop" script, then run `npm run start:desktop`; otherwise, run `npm run start`. | ||
|
||
|
@@ -77,22 +77,22 @@ If you aren't using VS Code, you can use the command line (such as bash, or Powe | |
|
||
If your add-in doesn't sideload in the document, follow the steps in [Sideload your add-in](#sideload-your-add-in) to sideload your add-in. Then continue to the next section to start debugging. | ||
|
||
1. Open developer tools in the browser. For Chrome and most browsers F12 will open the developer tools. | ||
1. Open developer tools in the browser. For Chrome and most browsers F12 opens the developer tools. | ||
1. In developer tools, open your source code script file (**functions.js** or **functions.ts**). Your custom functions code may be located near the end of the file. | ||
1. In the custom function source code, apply a breakpoint by selecting a line of code. | ||
|
||
If you need to change the code, you can make edits in VS Code and save the changes. Refresh the browser to see the changes loaded. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the same sentence as earlier but copilot didn't change it. Interesting. |
||
|
||
### Commands for building and running your add-in | ||
|
||
There are several build tasks available. | ||
Available build tasks: | ||
|
||
- `npm run watch`: builds for development and automatically rebuilds when a source file is saved | ||
- `npm run build-dev`: builds for development once | ||
- `npm run build`: builds for production | ||
- `npm run dev-server`: runs the web server used for development | ||
|
||
You can use the following tasks to start debugging on desktop or online. | ||
Use these tasks to start debugging: | ||
alison-mk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- `npm run start:desktop`: Starts Excel on desktop and sideloads your add-in. If the "start:desktop" script isn't present in the "scripts" section of the project's package.json file, then run `npm run start` instead. | ||
- `npm run start -- web --document {url}` (where `{url}` is the URL of an Excel file on OneDrive or SharePoint): Starts Excel on the web and sideloads your add-in. | ||
|
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the original statement that you "can't debug desktop Excel from the command line" is true. You can debug by right-clicking in the task pane and choosing debug to open the developer tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would be sufficient to simply remove the sentence?