1

We are using Excel Add-in side loaded for our application. I am trying to Set a Cell Value in Excel with Base64 Encoded content (that has formatted content). I see example of how set base64 encoded image but not the text content with formatting. I am able to insert simple text with below code but could not find a way to set base64 content into a cell.

I am looking at Office Js Excel https://learn.microsoft.com/en-us/javascript/api/excel/excel.range?view=excel-js-preview

Excel.run(async (context) => {
var activeCell = context.workbook.getActiveCell(); // get current active cell
activeCell.load(['address', 'values']);
await context.sync();

let newRange = activeCell.getOffsetRange(0,1); // right of the current cell where base64 content must be inserted
newRange.load(['values']);
await context.sync();
 
newRange.values = insert base 64 content??

I greatly appreciate any pointers you may have

user2596892
  • 93
  • 1
  • 9
  • 2
    Office JS do not support at this moment, would you please share a bit more on your scenario? therefore we can discuss what we can do to support you with existing API. thanks. – Raymond Lu Jun 16 '21 at 02:16
  • 1
    Thanks for your response. We have several docx contents (with bullets, bold, color text, tables, etc) stored as base64 encoded string in database. I am trying to programmatically insert these base64 strings into the cell. I am able to successfully insert docx base 64 into word via side loaded Add-in but cannot in excel so far. Thanks in advance – user2596892 Jun 16 '21 at 02:26
  • For word I am using method: insertFileFromBase64 – user2596892 Jun 16 '21 at 02:45

1 Answers1

0

Office Js current do not support set cell value from base 64 string, I have created a backlog (5193490) for this feature internally, would you please submt your request on this site and upvote your request? thanks.

https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform

Raymond Lu
  • 2,178
  • 1
  • 6
  • 19