Skip to content

[excel] Add lots of Range samples - #469

Open
Alison McKay (alison-mk) wants to merge 1 commit into
mainfrom
alison-mk-range
Open

Alison McKay (alison-mk) wants to merge 1 commit into
mainfrom
alison-mk-range

Conversation

@alison-mk

@alison-mk Alison McKay (alison-mk) commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Adding samples for all the range methods that didn't previously have samples.

@learn-build-service-prod

Copy link
Copy Markdown

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod

Copy link
Copy Markdown

Learn Build status updates of commit a9f8baf:

✅ Validation status: passed

File Status Preview URL Details
docs/sample-scripts/samples.yaml ✅Succeeded

For more details, please refer to the build report.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The samples align with documented API contracts, and no blocking issues were identified.

No open issues 🎉

What changed in this PR

Expands the Office Scripts API documentation with examples for ExcelScript.Range methods.

Changes:

  • Adds samples for range navigation, formatting, formulas, and values.
  • Demonstrates dependencies, dynamic arrays, cell controls, and grouping.
File Description
docs/​sample-scripts/​samples.yaml Adds method-specific Range samples for API documentation.

Review effort: Balanced

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran every script and things look good. I had a couple observations for your consideration.

'ExcelScript.Range#clearOrResetContents:member(1)':
- |-
/**
* This script resets checked checkboxes without removing their controls.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, this script does overwrite the cells by creating new checkboxes. Consider reworking this to tell the user to manually add checked checkboxes to the range.

* This script highlights the region around the active cell bounded by blank rows and columns.
*/
function main(workbook: ExcelScript.Workbook) {
const region = workbook.getActiveCell().getSurroundingRegion();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This throws an exception if you don't have any cells if data adjacent to the currently selected cell. Maybe add that need as a note?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants