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 / office script -- call ...
Power Automate
Answered

office script -- call different workbook from scipt

(0) ShareShare
ReportReport
Posted on by

Hi Guyzz,

i) Is their any way to call different workbook name in officescript or

ii) to refer different workbook or thats sheet in single office script.

iii ) Is their any way so that i can create two function for workbook to reading two excel files and perform several operaions like VBA?

iv) Can we pass file as a input parameter in office script?

 

Can i write code like this in office script:

v)  function ABCD(WorkbookA:ExcelScript.Workbook, WorkbookB:ExcelScript.Workbook ){

WorkBookA.getrange("F3")

WorkbookB.getrange(F3).... something like that, is their any way to achieve this.

 

where WorkbookA is different file and WorkbookB is different file.

 

 

Please help!!!!

 

Categories:
  • Verified answer
    MichelleRanMSFT Profile Picture
    Microsoft Employee on at

    Hi Anjali,

     

    Thanks for reaching out! An Office Script can only reference the workbook that it is currently running in. If you would like to build a workflow that can operate on multiple workbooks, you can run your Office Script within a Flow and make use of parameters/return values. For example, you can create a "Run script" action that runs an Office Script that reads and returns range F3 from workbook A. You can follow this with a second "Run script" action that reads and returns range F3 from workbook B. Then, you can use these return values in another step of your Flow. 

     

    Hopefully this helps! If you'd like to share details about what you're trying to accomplish, I can give more specific recommendations.

     

    Best,

    Michelle

  • IWantToKnow Profile Picture
    90 on at

    Thank you @MichelleRanMSFT , Do you have a sample flow/tutorial with a few office scripts for a few workbooks?

  • MichelleRanMSFT Profile Picture
    Microsoft Employee on at

    Hi @IWantToKnow - here are two samples that involve passing information between multiple workbooks:

    Let me know if that helps, or if you have any questions!

  • IWantToKnow Profile Picture
    90 on at

    Thank you!

    The first example looks like a great starting point for any office script that involves more than one workbook...

    Thanks!

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