2

I am specifically trying to call this function on an Array:

https://learn.microsoft.com/en-us/javascript/api/excel/excel.range?view=office-js#getcellproperties-cellpropertiesloadoptions-

It is really not clear from the documentation what is required to make this work. I am definitely missing something here. Below is the current state of my code.

I have also checked that the add-in I am building is running in a version of Excel that is using API v1.9.

I have tried setting various objects that match the interface described by cellPropertiesLoadOptions - but again not sure what the requirement actually is from the docs.

async function getFormatsForCellRange () {
  return await Excel.run(async context => {
    const table = await context.workbook.tables.getItem(observationConst.TABLE_NAME)
    const range = table.getRange()
    const cellProperties = range.getCellProperties()
    console.log(cellProperties)
  })
}

The documentation states that the result of calling getCellProperties should be a 2d array.

Adam McWha
  • 41
  • 2

1 Answers1

2
var actualData = rangeSrc.getCellProperties({
 format: {
    font: {
           bold: true,
           color: true,
           fill: true
           italic: true,
           name: true,
           underline: true,
           size: true,
           strikethrough: true,
           subscript: true,
           superscript: true,
           tintAndShade: true
    }
 }
Adam McWha
  • 41
  • 2