Excel Error Codes

How to Fix Intermittent Office Script Workbook Not Found Errors in Excel

Huma Ashraf ChHuma Ashraf Ch Nov 3, 2026 872 views

Question details

The user needs to resolve an intermittent 'Workbook not found' error that occurs when a Power Automate flow attempts to run an Office Script on a newly converted Excel file.

How to Fix Intermittent Office Script Workbook Not Found Errors
Product
Microsoft Excel / Power Automate
Device & OS
not provided
Scenario
Automating the conversion of a CSV file to Excel and immediately executing an Office Script via Power Automate.
Observed behavior
The flow randomly fails with a 'Workbook not found' error, but succeeds when the file is manually selected again, pointing to a potential timing or file identifier synchronization issue.
Before you start

Review your Power Automate flow run history to confirm whether the 'Create file' step successfully finishes before the 'Run script' step begins to rule out immediate synchronization delays.

Solution 1Recommended

Add a Delay Action in Power Automate

Introduce a wait time between file creation and script execution to ensure the file is fully indexed and available.

When a flow creates a new Excel file and immediately tries to run an Office Script on it, cloud storage platforms like OneDrive or SharePoint may not have finished indexing the file. Adding a deliberate pause gives the system enough time to recognize the new file.

1
Edit the Power Automate Flow

Open your flow in the Power Automate editor and locate the step where the CSV is converted to an Excel file.

2
Insert a Delay Action

Click the '+' icon between the 'Create file' action and the 'Run script' action. Search for and select the 'Delay' action.

3
Configure the Delay Duration

Set the 'Count' to 30 or 60, and the 'Unit' to 'Second'. This provides an adequate buffer for the file creation to finalize.

4
Save and Test

Save the flow and run a manual test to verify that the 'Workbook not found' error no longer occurs.

Add a Delay Action in Power Automate
Timing Issue Resolved: By allowing a short pause, you prevent the script from executing on a file identifier that the server has not yet registered.
Free Microsoft Office alternative

Switch to WPS Office for a Reliable Spreadsheet Experience

If you frequently encounter synchronization, timing, or script errors in cloud-heavy ecosystems, consider WPS Office. It is a free, lightweight, and robust alternative that allows you to manage data and edit spreadsheets smoothly without complex cloud-flow dependencies.

  1. 1. Download and Install: Visit the official WPS website to securely download and install the free WPS Office suite on your computer.
  2. 2. Open Your Spreadsheets: Launch WPS Spreadsheets and open your existing .xlsx or .csv files seamlessly without worrying about formatting loss.
  3. 3. Edit with Ease: Enjoy robust formula support, intuitive chart tools, and reliable local editing without complex automation flow errors.
Highly compatible with Microsoft Excel formats (.xlsx, .xls, .csv).Lightweight desktop application that works reliably offline without heavy reliance on cloud synchronization.Familiar user interface allows for immediate productivity and a seamless transition from Microsoft Office.Completely free alternative to expensive subscription-based software suites.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Power Automate flow intermittently say 'Workbook not found'?

This is almost always a timing issue. The flow attempts to execute the Office Script before SharePoint or OneDrive has fully processed, indexed, and unlocked the newly converted Excel file.

How long should the delay be before running the Office Script?

A delay of 30 to 60 seconds is generally sufficient to ensure the newly created file is properly registered by the server and available for the script to access.

Where can I get advanced support for JavaScript and Office Scripts?

The Microsoft OfficeDev repositories on GitHub are the recommended community resource for troubleshooting specific JavaScript API behaviors, Office Script limitations, and reporting persistent bugs.