web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Updating Stock Information in Excel Online

(0) ShareShare
ReportReport
Posted on by 4

Hi all,

 

I want to build a Stock Ticker using the new Stock data type in Excel. I have made good progress but i found a snag. In order to refresh the stock information you need to hit the Refresh button in excel. For this I created the file on desktop and then copied that to a folder in Sharepoint. After reading about this situation I found that you can create a script to perfom the automatic refresh. The code looks like this:

 

 

function main(workbook: ExcelScript.Workbook) {
 // Your code here
 let worksheet = workbook.getWorksheet("Sheet1");
 workbook.refreshAllDataConnections();
 worksheet.calculate
 console.log("I did it")
 let range = worksheet.getRange("B8");
 console.log(range.getValues());
 range.setFormula("=now()");
 console.log(range.getValues());
}

 

 

If I run the code manually it runs with no issues whatsoever. Now I am trying to get this code to run in a flow. I created the following flow:

5rq4eghGpD.png

The flow runs without any issues as you can see below.

 

chrome_XXm10uYHJT.png

 

The issue is the data is not refreshed. Am I missing something? 

 

Thank you in advance for any advice.

 

I have the same question (0)
  • Expiscornovus Profile Picture
    32,891 Most Valuable Professional on at
    Re: Updating Stock Information in Excel Online

    Hi @dorinilut,

     

    When I look at your Office Script I see you are setting the B8 cell to the NOW() formula after you refreshed the data. Is that correct?

     

    Shouldn't that be the other way around?

  • dorinilut Profile Picture
    4 on at
    Re: Updating Stock Information in Excel Online

    Hi,

     

    It does not matter where the NOW() formula goes. Still the Refresh is not affecting the stock data information.

  • Expiscornovus Profile Picture
    32,891 Most Valuable Professional on at
    Re: Updating Stock Information in Excel Online

    Hi @dorinilut,

     

    Found this thread on Stack Overflow, looks like it's not supported yet on Excel on the web.

    https://stackoverflow.com/questions/64184867/refresh-all-queries-and-connections-of-an-excel-workbook-excel-online-using-of?rq=1

     

    Hope this helps a bit.

  • dorinilut Profile Picture
    4 on at
    Re: Updating Stock Information in Excel Online

    It does. At least now I can watch that github thread. In the meantime I managed to get the info using a different method.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 655 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 371 Moderator

#3
chiaraalina Profile Picture

chiaraalina 276

Last 30 days Overall leaderboard