Skip to content

ExcelScript.ListDataValidation.source can't take a ExcelScript.Range #290

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.

Activity

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

Metadata

Metadata

Assignees

Labels

Status: in backlogIssue is being tracked in the backlog but timeline for resolution is unknownType: product bugBug in the Office Scripts platform or Office Scripts APIs

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions