I have developed a mobile power app for my engineers to complete treatment reports in the field and capture signatures.
I created a flow to retrieve the report information and signature images from the app and upload them to a Sharepoint list + doc library. All of this work perfectly.
I also want to output the captured information (+signatures) in a template that can be converted to PDF and given to the customer.
The problem I'm having is that the flow fails on the script when trying to add the image to the excel worksheet. I am confused as I mostly plagiarised the script
from this thread, where it has worked perfectly for others, and I know the (two) base64 string(s) to be correct, as i've run it through an online converter, which outputs images of the signatures that were originally captured.
This suggests the problem lies in line 6 of the script. Unfortunately, I'm not an expert, and the last time i played with Excel scripts was over a decade ago with VBA rather than Office Scripts. I have tried playing with it in as far as i can, but nothing seems to offer any success. To me, the script actually appears fine, and it seemingly worked for others according to the other thread. As the base64 script is correct (and doesn't include the data: or /png etc), I'm left bewildered and hoping that someone can spot where i've gone wrong (that person will have my eternal gratitude!). Script included below

function main(workbook: ExcelScript.Workbook, base64ImageString1:string, base64ImageString2:string)
{
const sheet = workbook.getWorksheet("Output");
const range1 = sheet.getRange("C43");
const range2 = sheet.getRange("I43");
let image1 = sheet.addImage(base64ImageString1);
image1.setTop(range1.getTop());
image1.setLeft(range1.getLeft());
image1.setWidth(range1.getWidth());
image1.setHeight(range1.getHeight());
image1.setPlacement(ExcelScript.Placement.twoCell);
let image2 = sheet.addImage(base64ImageString2);
image2.setTop(range2.getTop());
image2.setLeft(range2.getLeft());
image2.setWidth(range2.getWidth());
image2.setHeight(range2.getHeight());
image2.setPlacement(ExcelScript.Placement.twoCell);
}