Office script to copy table image copies 'wrong' format

Salazar, Jaime 11 Reputation points


I'm not sure if this is the place to report what I think is a bug in a function. In Power Automate, I am copying a table image from an Excel file into the body of an email. In order to do that, I have used the script I found here:

Specifically, under the section for Sample code: Calculate and extract Excel chart and table, I'm finding the line const tableImage = table.getRange().getImage();.

The Excel file contains the cells B9 and G9 where the text is properly wrapped:

However, this gets copied into the email body with what appears to be unwrapped text:

Is there something I can add to my script to keep the original, correct formatting? Or is this a bug in the Range.getImage() function?

Thank you

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
2,460 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. AlexJerabek 81 Reputation points Microsoft Employee

    Hi @Salazar, Jaime ,

    Thank you for reporting this issue. This does appear to be a bug in the Excel for the web implementation of this API (which affects Office Scripts). We are investigating a fix.

    1 person found this answer helpful.

  2. Cristiane Ricci 1 Reputation point

    I'm facing the same issue, is there a solution yet?

    0 comments No comments