0

I have an extremely simple ExcelScript that I use to copy cells from one sheet to another. It works with zero issues when called from within Excel itself - both from the desktop application and the web application. However, when I call the script from Power Automate, it only partially runs. Usually, it'll only copy the first two ranges, and not copy the third. Sometimes it'll copy a portion of the third.

When run from Excel, it does everything with zero issues. When run from PowerAutomate, it doesn't fail or throw any error messages, but it does not complete the action. Sometimes it'll partially copy the final range...sometimes (every third/fourth time) it'll copy the whole thing. Every time it drives me nuts.

Am I missing something? I've tried running it on only one table at a time, and I'm currently testing it using a Power Automate flow that only has "Manually Trigger Action --> Run Script" as the flow.

function main(workbook: ExcelScript.Workbook) {


  let emailtable = workbook.getWorksheet("emailtable");
  let emaildata = workbook.getWorksheet("emaildata");

  emailtable.getRange("B2").copyFrom(emaildata.getRange("B3:P35"),ExcelScript.RangeCopyType.values, false, false);

  emailtable.getRange("B149").copyFrom(emaildata.getRange("B95:J105"),ExcelScript.RangeCopyType.values, false, false);

  emailtable.getRange("B38").copyFrom(emaildata.getRange("B43:P90"),ExcelScript.RangeCopyType.values, false, false);
}
1
  • 1
    can you share what your flow looks like? Commented Apr 17 at 13:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.