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 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:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,175 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
    33,175 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard