OfficeDev / OfficeDev/office-scripts-docs-reference
ExcelScript.ListDataValidation.source can't take a ExcelScript.Range
Open
@jeremy-msft is already working on this.
Since Sep 20, 2023.
Status: in backlog
Type: product bug
- Dominant language
- TypeScript
- Stars
- 71
- Forks
- 36
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 12
Description
When I run the following code snippet, it runs indefinitely without performing any action:
function main(workbook: ExcelScript.Workbook) {
const rangeDataValidation = workbook.getActiveWorksheet().getRange("B2:B5").getDataValidation();
rangeDataValidation.setRule({
list: {
inCellDropDown: true,
source: workbook.getWorksheet("Data").getRange("A1:A3")
}
});
}
However, when I run the following code:
function main(workbook: ExcelScript.Workbook) {
const rangeDataValidation = workbook.getActiveWorksheet().getRange("B2:B5").getDataValidation();
rangeDataValidation.setRule({
list: {
inCellDropDown: true,
source: "test1,test2,test3"
}
});
}
Everything works as expected. Am I doing something wrong with the cell range in the first code snippet?
(If this is not the appropriate place for this issue, please redirect me to the correct repository.)
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: eec6dad6-3b54-5f6f-6792-6f8b85bcb13c
- Version Independent ID: 0558dc94-2b87-5ab5-8a9b-5117f12acf8d
- Content: ExcelScript.ListDataValidation interface - Office Scripts
- Content Source: docs/docs-ref-autogen/excel/excelscript/excelscript.listdatavalidation.yml
- Service: excel
- Sub-service: scripts
- GitHub Login: @o365devx
- Microsoft Alias: o365devx
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.