Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

refresh excel every morning

Hello everyone,


i try the following.

A workflow that every morning open my excel file, refreshed it, saves and close again.

What would the process look like? 🤗

Thank you in advance






Frequent Visitor



Are you working in an Excel Online file?

In that case, you can have a Flow run every day "Reoccurence" and have an Excel Script refresh the data.

If you're unfamiliar with this or unsure how to do so, let me know, and I'll show you.




Hi @RemcoV16 ,


yes. Please show me how i can update this. I thank you very much.  🙂




Frequent Visitor



First ensure that your Excel file is stored in an online location (Like Drive or SharePoint). Not sure how it works with an offline Excel file. Then, I would build something like this:



The Flow triggers daily at 8:00 AM now and runs a created script (similar to Excel Macro's).

You can either record the script yourself, or paste the code below in a new script.


function main(workbook: ExcelScript.Workbook) {
  // Refresh all data connections


Both can be done via the "Automate" Tab in Excel (see highlighted below (even though in Dutch)):


After refreshing the data, the Flow will send an email to the email-address filled in. 


If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up.




Thank for your solution but i have a little problem.


i cant see my script although i creates one.

Can you see your script within Excel Online? Otherwise it might not have saved correctly.

If you have added the script with your Flow open, be sure to save the Flow, refresh the page and try again.

i dont know why i cant see my script ... 😕 i already saved an close the excel file


Frequent Visitor

If you open your Excel online, do you see the script?



If it does not show here, your Flow won't find it either.


Thank you very much for your efforts. I managed to create.

But unfortunately I am still faced with one of the following questions / problems.



I created the workflow and I want it to run every minute.
After the workflow was successfully completed, I opened the Excel list, which is saved on my desktop, and the data has not been updated: /

Do I have to make further settings in the Excel list?



I'm unsure whether you are able to do this with a file that is stored on your desktop.

Could you try saving the Flow in SharePoint or Drive, and see if the file gets updated that way?

the code isn't working 


and the excel file is in the onedrive 🙂 


I am trying to accomplish the same thing. I have been working on this for days.
Here is what we have.
An excel file saved to SharePoint library:

  • excel file has two data connections queries each to a different SharePoint list
  • excel file has 4 power query tables performing tasks
  • excel file exceeds 15,000 rows

This works fine on excel desktop - manual Refresh All works perfect, there is a setting to refresh on file open and every 30 minutes - those also work fine on desktop.

What we are trying to do is AUTOMATE the refresh all, then send the resulting refreshed excel file attached to an email. ( the flow to send the scheduled email works perfectly!)
HOWEVER; The data is NOT refreshed when fetched by the flow.
Any help would be greatly approciated.

New Member


I have created the following office script to schedule an automated refresh on the Excel that uses Powerquery every day. The power automate flow executes fine with no errors but the office script does not refresh. I have also manually refreshed which does work but the automation doesn't work.
Could you please assist here?




We have the same issue. The online script will not run the refresh. I even tried adding a delay, then close> still no refresh.
As an alternative I attempted to use 'Desktop Power Automate'  - and it worked, the excel file (with power queries) on sharepoint > opened> refreshed> waited> and closed.  

BUT !!!
That did not solve our requirement - only the first
Step 2 - need to schedule a daily email with the file attached after refresh.
To call desktop flow from online is a 'premium' license - which we don't have.

online PA - wont refresh file or open file do to query

desktop - cant run schedule email

online script - cant send email

Regular Visitor

Hello everyone.


I have been working on this also for some time and found a solution that is working for me.


In my case I have to refresh the data in one worksheet with the data in another (I haven't tried this for external data sources).


What I did was to add to the script some hide/unhide worksheet orders, leaving the document as before. However, the document refreshed. Something like this (for my document):


function main(workbook: ExcelScript.Workbook) {
  // Refresh all data connections
  let form1 = workbook.getWorksheet("Form1");
  // Set sheet visibility to ExcelScript.SheetVisibility.visible
  let def = workbook.getWorksheet("Def");
  // Set sheet visibility to ExcelScript.SheetVisibility.visible
  let normas = workbook.getWorksheet("Normas");
  // Set sheet visibility to ExcelScript.SheetVisibility.visible
  let solicitud = workbook.getWorksheet("Solicitud");
  // Set sheet visibility to ExcelScript.SheetVisibility.visible
  // Set sheet visibility to ExcelScript.SheetVisibility.hidden
  // Set sheet visibility to ExcelScript.SheetVisibility.hidden
  // Set sheet visibility to ExcelScript.SheetVisibility.hidden
  // Set sheet visibility to ExcelScript.SheetVisibility.hidden

Hope this also works for you.

New Member

I was also trying to use Power Automate to refresh an Excel file which pulls data from a Sharepoint List.  After researching and trying, my conclusion is that Enterprise license is needed.  Correct me if I'm wrong.


Currently in Excel, if you click Get Data, you need Enterprise license in order to select Sharepoint List as a source, which I don't have.  The way I build refresh-able connections to Sharepoint Lists is by going to the List, click the export button which downloads a query file, and open the file in Excel.  This connection works fine in desktop Excel, but DOES NOT work in the web version, and I assume if you use Power Automate to refresh this connection, it will not refresh. 


Seems to be a dead end for me, so I did a work around.


Since the Sharepoint List is populated by Power Automate, I made change to the Flow so that whenever an item is inserted into the List, also add a new row to the Excel file.  This way the file is always up to date.


Even if the List is not populated by Power Automate, you can probably set up a Flow triggered by insertion, and add that insertion to the Excel.

Hi @RemcoV16 


I love this.  Set up the script and cloud flow.  My data connection is to an external Excel file.  Seems that Excel for Web only allows OBdata or table/range (within same workbook).  so....this won't work?

Super User
Super User

If you have a premium Power Automate license, you can Get your rows from a premium SQL action, then use this template to Update & Create all those rows in an Excel table:
And if you don’t have a premium Power Automate license, but you have an Azure account, then you can convert the flow to an Azure Logic App where SQL actions are not premium.

It takes a bit more set up than just a refresh, but it can work if the refresh doesn’t.

New Member

 This is brilliant!  I've set up both of your Excel Batch Upsert V4 and Excel Batch Upsert V4b flows and will respond back to this post and the original.




Helpful resources



Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,651)