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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Updating Stock Informa...
Power Automate
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.

 

Categories:
  • Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at

    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

    Hi,

     

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

  • Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at

    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

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 331 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard