OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
690 stars 95 forks source link

addImage() not working on Excel Online #5025

Open GTMEnrique opened 1 month ago

GTMEnrique commented 1 month ago

I am expecting some errors when using the method addImage() in Excel Online and through Power Automate, despite providing a valid base64 string. The error does not appear when using Excel in its desktop version, with the same string.

Expected behavior

addImage() to add an image without problems.

Current behavior

Desktop: Working as expected. Online and Power Automate: For some images, it complains that the base64 is invalid.

Steps to reproduce

  1. Open attached txt. It contains the script with a valid base64 string.
  2. Create new Script and copy the txt on it.
  3. Run the Script in Desktop version and in Excel Online.

If you need me to provide the script in another way, let me know.

Useful logs

We were unable to run the script. Please try again. Office JS error: Line 11: Worksheet addImage: The argument is invalid or missing or has an incorrect format.

Regards Enrique AddImage Error JS.txt

jonahkarpman commented 1 month ago

Thank you for reporting and providing detailed information about this issue! I've assigned this issue to our SME for further investigation.