Skip to content
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

The droplist length is limited to 258 bytes in creating validation, what is the purpose of the limitation, is there a way to set a longer droplist #476

Closed
wsyzxcn opened this issue Aug 20, 2019 · 1 comment

Comments

@wsyzxcn
Copy link

wsyzxcn commented Aug 20, 2019

No description provided.

@painkuter
Copy link

painkuter commented Oct 17, 2019

You can create list on hidden sheet, then add excelize.DefinedName and formula with it:

definedName := &excelize.DefinedName{
	Name:     "uname",
	Comment:  "comment,
	RefersTo: "HiddenSheet!$A$1:$A$10",
	Scope:    "",
}
err := f.SetDefinedName(definedName)
if err != nil {
	return nil, err
}
validation := excelize.NewDataValidation(true)
validation.Formula1 = fmt.Sprintf("<formula1>%s</formula1>", definedName.Name)
validation.Sqref = "B1:B1"
validation.Type = "list"

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

No branches or pull requests

3 participants