获取工作簿属性

  1. func (f *File) GetWorkbookPrOptions(opts ...WorkbookPrOptionPtr) error

GetWorkbookPrOptions 用于获取工作簿属性。可选参数:

参数数据类型
Date1904bool
FilterPrivacybool
CodeNamestring
  • 例如,获取工作簿属性:
  1. f := excelize.NewFile()
  2. var (
  3. date1904 excelize.Date1904
  4. filterPrivacy excelize.FilterPrivacy
  5. codeName excelize.CodeName
  6. )
  7. if err := f.GetWorkbookPrOptions(&date1904); err != nil {
  8. fmt.Println(err)
  9. }
  10. if err := f.GetWorkbookPrOptions(&filterPrivacy); err != nil {
  11. fmt.Println(err)
  12. }
  13. if err := f.GetWorkbookPrOptions(&codeName); err != nil {
  14. fmt.Println(err)
  15. }
  16. fmt.Println("Defaults:")
  17. fmt.Printf("- date1904: %t\n", date1904)
  18. fmt.Printf("- filterPrivacy: %t\n", filterPrivacy)
  19. fmt.Printf("- codeName: %q\n", codeName)

得到输出:

  1. Defaults:
  2. - filterPrivacy: true
  3. - codeName: ""