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 / OfficeScript to compar...
Power Automate
Answered

OfficeScript to compare data in two Workbooks (must PowerAutomate be used?)

(0) ShareShare
ReportReport
Posted on by 19

Hello Power Automate pros,

I was on MS Office community with my question and they sent me here as apparently Office Script questions are answered here. I hope I can get some info.

 

I am starting to dabble with Office Scripts inside MS Excel to automate certain simple data processes. Have been using VBA before that...

I need to create a Script which will essentially compare a list of company names in Workbook A with another list reference list in Workbook B. When there are matches, it will return an answer in a new column in Workbook A.
I'm reading the the Office Script documentation with a Use-case example and it is talking about using Power Automate in order for the data to be compared in two separate workbooks.

 

I'm wondering Power Automate is a must here to achieve the above? Wouldn't that script be able to run if the Workbook B was stored in the same directory than the Office Script itself?

Thanks

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @AlexBrandt ,

     

    I need to create a Script which will essentially compare a list of company names in Workbook A with another list reference list in Workbook B. When there are matches, it will return an answer in a new column in Workbook A.

     

    I think there is no need to use Office Script to do that . Just try excel function 'vlookup':

    How to use VLOOKUP in Excel 

     

    Best Regards,
    Bof

  • AlexBrandt Profile Picture
    19 on at

    Hello @v-bofeng-msft 

    Thanks for the suggestions.
    I'm well aware of the VLOOKUP function. But in this case its different.
    My script will compare 3 data points (Company names, website and Linkedin url) and if one matches will return some information. Not only that but the script pulls de domains names only out of the URLs before doing the matching...

    We are working with lists with thousands of lines etc. Its not so workflow friendly to have to pull formulas and adapt them everytime.

  • GeoffRen Profile Picture
    Microsoft Employee on at

    Unfortunately cross workbook access from a single script is not currently supported. This feature is in our backlog, however, we do not have a timeline to share. Using Power Automate for this is the recommended workaround in the meanwhile.

  • AlexBrandt Profile Picture
    19 on at

    Hello @GeoffRen 
    Thanks for the info.

    I see that it is possible to to make an external API call with Office Script and fetch data. I'm pretty new to all this, but wondering if it would be possible to fetch data to the sheet stored in SharePoint or OneDrive?

  • Verified answer
    GeoffRen Profile Picture
    Microsoft Employee on at

    It may be possible with external API calls by calling the Graph API, for example Get Table. You'll have to figure out the auth flow, but you can probably test it by getting an auth token from the Graph Explorer and hardcoding that in your Graph request.

     

    Click Access token and it should display your auth token used in Graph requests. 

    GeoffRen_0-1699987927927.png

     

  • AlexBrandt Profile Picture
    19 on at

    Hello @GeoffRen 

    Wow ok. I had not idea about the existence of the Graph Explorer. I will need to read more about that.
    Thank you for this.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 60 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 54

#3
Expiscornovus Profile Picture

Expiscornovus 47 Most Valuable Professional

Last 30 days Overall leaderboard