Workbook Object工作簿对象
For a given workbook object 对于给定的工作簿对象wb
:wb
:
wb.SheetNames
is an ordered list of the sheets in the workbook.是工作簿中工作表的有序列表。
wb.Sheets
is an object whose keys are worksheet names (from 是一个对象,其键是工作表名称(来自SheetNames
) and whose values are worksheet objects.SheetNames
),其值是工作表对象。
wb.Props
is an object storing the standard properties. 是存储标准属性的对象。wb.Custprops
stores custom properties. 存储自定义属性。Since the XLS standard properties deviate from the XLSX standard, XLS parsing stores core properties in both places.由于XLS标准特性与XLSX标准不同,XLS解析将核心特性存储在两个位置。
wb.Workbook
stores workbook-level attributes.存储工作簿级别的属性。
When reading a file, 读取文件时,wb.bookType
is the determined book type.wb.bookType
是已确定的工作簿类型。
File Properties文件属性
The various file formats use different internal names for file properties. 各种文件格式对文件属性使用不同的内部名称。The workbook 工作簿Props
object normalizes the names:Props
对象规范化名称:
File Properties文件属性 (click to hide)
JS Name | Excel Description |
---|---|
Title | Summary tab "Title" |
Subject | Summary tab "Subject" |
Author | Summary tab "Author" |
Manager | Summary tab "Manager" |
Company | Summary tab "Company" |
Category | Summary tab "Category" |
Keywords | Summary tab "Keywords" |
Comments | Summary tab "Comments" |
LastAuthor | Statistics tab "Last saved by" |
CreatedDate | Statistics tab "Created" |
For example, to set the workbook title property:例如,要设置工作簿标题属性:
if(!wb.Props) wb.Props = {};
wb.Props.Title = "Insert Title Here";
Custom properties are added in the workbook 自定义属性添加到工作簿Custprops
object:Custprops
对象中:
if(!wb.Custprops) wb.Custprops = {};
wb.Custprops["Custom Property"] = "Custom Value";
Writers will process the 写入程序将处理选项对象的Props
key of the options object:Props
密钥:
/* force the Author to be "SheetJS" */
XLSX.write(wb, { Props: { Author: "SheetJS" } });
Workbook-Level Attributes工作簿级别属性
wb.Workbook
stores workbook-level attributes.存储工作簿级别的属性。
Defined Names已定义的名称
wb.Workbook.Names
is an array of defined name objects. Defined names are discussed in more detail in "Defined Names"是已定义名称对象的数组。定义的名称在“定义的名称”中有更详细的讨论
Workbook Views工作簿视图
wb.Workbook.Views
is an array of workbook view objects which have the keys:是工作簿视图对象的数组,这些对象具有以下键:
Key | Description |
---|---|
RTL | true ,则从右向左显示 |
Miscellaneous Workbook Properties其他工作簿属性
wb.Workbook.WBProps
holds other workbook properties:保存其他工作簿属性:
Key | |
---|---|
CodeName | VBA Workbook Name |
date1904 | epoch: 0/false for 1900 system, 1/true for 1904 |
filterPrivacy |
Sheet Metadata工作表元数据
wb.Workbook.Sheets
is an array of sheet metadata objects which have the keys:是图纸元数据对象的数组,这些对象具有以下键:
Key | Description |
---|---|
Hidden | |
CodeName | VBA Sheet Code Name |