Excel.CellPropertiesLoadOptions interface
Represents which cell properties to load, when used as part of a "range.getCellProperties" method.
Properties
address | Specifies whether to load on the |
address |
Specifies whether to load on the |
format | Specifies whether to load on the |
hidden | Specifies whether to load on the |
hyperlink | Specifies whether to load on the |
style | Specifies whether to load on the |
Property Details
address
Specifies whether to load on the address
property.
address?: boolean;
Property Value
boolean
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/42-range/cell-properties.yaml
await Excel.run(async (context) => {
const cell = context.workbook.getActiveCell();
// Define the cell properties to get by setting the matching LoadOptions to true.
const propertiesToGet = cell.getCellProperties({
address: true,
format: {
fill: {
color: true
},
font: {
color: true
}
},
style: true
});
// Sync to get the data from the workbook.
await context.sync();
const cellProperties = propertiesToGet.value[0][0];
console.log(
`Address: ${cellProperties.address}\nStyle: ${cellProperties.style}\nFill Color: ${cellProperties.format.fill.color}\nFont Color: ${cellProperties.format.font.color}`);
});
addressLocal
Specifies whether to load on the addressLocal
property.
addressLocal?: boolean;
Property Value
boolean
format
Specifies whether to load on the format
property.
format?: Excel.CellPropertiesFormatLoadOptions;
Property Value
hidden
Specifies whether to load on the hidden
property.
hidden?: boolean;
Property Value
boolean
hyperlink
Specifies whether to load on the hyperlink
property.
hyperlink?: boolean;
Property Value
boolean
style
Specifies whether to load on the style
property.
style?: boolean;
Property Value
boolean
Office Add-ins