AutoFit - for a range RRS feed

  • Question

  • I have an Excel worksheet that has 5 tables with differing rows and columns.  I am using the JavaScript API. I thought there would be a way to use the worksheets.getrange() to supply the format: width: autofit. When I look at the documentation it says range.format is read-only. Why is that? And is there a way to autofit columns on a worksheet that I am just missing?

    Note I know I can bind to the tables and do it for each table but that is not an option because I need to do this for the whole sheet.

    Thanks, Brian

    • Edited by bedwar2 Monday, February 8, 2016 4:45 PM
    Monday, February 8, 2016 4:38 PM


  • Hi Braian,

    I am not able to understand the secnario you were handling. Since the Excel application already provide the autofit feature why we need to implement it in the Office add-in.

    Base on my understnading, the autofit is helpful when we want to format the table data when we insert into the Excel so that the Office add-in provide the format option when we set the table data.

    Hope it is helpful.

    Regards & Fei

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, February 9, 2016 2:38 PM