cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amyhsieh11
Helper I
Helper I

Run excel script- workbook not found

Hi,

 

I build a flow that call a script to update excel column. 

But sometimes it cannot run successfully, the error message shows that workbook not found.

↓ sometimes it work successfully, sometimes not.

amyhsieh11_1-1626347444636.png

↓ error details: 
We were unable to run the script. Please try again.
Workbook not found.
clientRequestId: a7c1c298-fd1e-4f8f-b41f-102aa0bfdf08

amyhsieh11_0-1626347172896.png

 

I think the reason might be our member will filter the excel while the script update the column. 

I tried to unhide the worksheet and ran the flow again, but it still failed.


Could anyone tell me the actual reason why the script sometimes can run and sometimes not?

and how to resubmit the flow again and run the script successfully?

 

Thanks in advance! 

 

9 REPLIES 9
GeoffRen
Microsoft
Microsoft

Could you post the script and workbook details so I can try and repro it?

amyhsieh11
Helper I
Helper I

Hi @GeoffRen 

 

following is the script:

 

function main(
  workbook: ExcelScript.Workbook,
  sheetName: string,
  tableName: string,
  pn: string,
  orderNumber: string,
  shipDate: string,
  oeNumber: string) {

  const tbl = workbook.getWorksheet(sheetName).getTable(tableName);
  const rowCount = tbl.getRowCount();
  const values = tbl.getRange().getValues();
  const pnIdx = 14;
  const orderNumberIdx = 25;
  const ScheduledshipDateIdx = 38;
  const oeNumberIdx = 39;

  for (let i = 1; i <= rowCount; i++) {
    if (values[i][pnIdx] == pn && values[i][orderNumberIdx] == orderNumber) {
      tbl.getRange().getCell(i, ScheduledshipDateIdx).setValue(shipDate);
      tbl.getRange().getCell(i, oeNumberIdx).setValue(oeNumber);
    }
  }
}

 

 

sheetName: Raw Data

tableName: 表格2

 

But there are lots of data in my workbook, may I ask that what kind of information do you need?

amyhsieh11
Helper I
Helper I

hi @GeoffRen 

 

I'm considering that the reason why my script cannot work successfully might be the data is too large?

Now, there are around 86,000 cells in my worksheet. (sheetName: 'Raw Data')

I tried to run the script in 'Raw Data', there is nothing change.

But if I tried to run the script in 'Raw Data_test' which only has 500 cells, it works!

 

 

It shouldn't be a size issue, I can run a script successfully on a file with 700,000 x 26 cells filled in. Do all scripts fail when run on this workbook? What happens if you moved this file to a different location and run it? So if it's on SharePoint what happens if the file lives in OneDrive?

amyhsieh11
Helper I
Helper I

Hi @GeoffRen 

 

I tried to copy the excel to the same SPO folder with a new name and ran the script on the copied workbook, it worked successfully. 😮 so it's really not the size issue.

therefore, I'm considering that if the script cannot run successfully might be that multiple users edit the workbook in the same time?

amyhsieh11_0-1626848963572.png

 

 

Are these all the same 404 error? If it's failing due to multiple edits at the same time we'd probably expect a different error than 404. It sounds like the original workbook might have something wrong with it. Can you post the error details of another recent one (including the clientRequestId)?

amyhsieh11
Helper I
Helper I

Hi @GeoffRen 

 

Yes, there are all 404 error. clientRequestId: f8c469c3-8ab5-491e-9b90-c1e893cfc6c8

amyhsieh11_0-1626924838719.png

but it's weird... all the setting were the same but the flow worked fine today... 

If you want my guess, if it's working now then this was probably a bug from SPO and it just took them a couple days to fix it and deploy it. If it keeps happening just let me know and I can keep looking into this!

amyhsieh11
Helper I
Helper I

Hi @GeoffRen 

 

OK, I will keep tracking on this issue, if it happen again, I will let you know. 🙂

Thanks for your assistance.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,274)