Replies: 1 comment
-
Excelize support add form controls by package main
import (
"fmt"
"github.com/xuri/excelize/v2"
)
func main() {
f := excelize.NewFile()
defer func() {
if err := f.Close(); err != nil {
fmt.Println(err)
}
}()
if err := f.AddFormControl("Sheet1", excelize.FormControl{
Cell: "A2",
Type: excelize.FormControlCheckBox,
Text: "Checkbox 1",
}); err != nil {
fmt.Println(err)
return
}
if err := f.AddFormControl("Sheet1", excelize.FormControl{
Cell: "A4",
Type: excelize.FormControlCheckBox,
Text: "Checkbox 2",
Checked: true,
}); err != nil {
fmt.Println(err)
return
}
if err := f.SaveAs("Book1.xlsx"); err != nil {
fmt.Println(err)
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone, I'd like to know if there's a way for me to insert a checkbox into the spreadsheet. I'm currently using version 2 of the excelize package.
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions