FieldDescriptor.LookupSheetId(属性)
说明
可读写
引用字段里 引用sheet的Id,要通过Sheet Id获取Sheet的实例可以通过 Application.Sheets.ItemById(id)
返回值
String
浏览器环境示例
javascript
async function example() {
await instance.ready();
const Application = instance.Application
const fieldDescriptor = await Application.Sheets("数据表").FieldDescriptors("@查找引用")
const prop = await fieldDescriptor.Lookup
const lookUpSheet = await Application.Sheets.ItemById(prop.LookupSheetId)
const lookupField = await lookUpSheet.FieldDescriptors(prop.LookupFieldId)
console.log(await lookupField.Name)
}
脚本编辑器 示例
javascript
function main() {
const fieldDescriptor = Application.Sheets("数据表").FieldDescriptors("@查找引用")
const prop = fieldDescriptor.Lookup
const lookUpSheet = Application.Sheets.ItemById(prop.LookupSheetId)
const lookupField = lookUpSheet.FieldDescriptors(prop.LookupFieldId)
console.log(lookupField.Name)
}
main()