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 / How to get opened Exce...
Power Automate
Answered

How to get opened Excel workbook with partial Filename

(0) ShareShare
ReportReport
Posted on by 566

I need to get already opened workbook with partial filename which contains "EXPORT"

i managed to get the full path with "get files into folder" but i cannot get the file with the variable.

Any suggestion?

 

  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @Sormick ,

     

    Please ellabroate you issue.If possible share the screenshot of your flow.

    To launch the file with Get Files in Folder action variable is as shown in below image.

    VishnuReddy1997_0-1714472640425.png

     

    (Note:- if you got your solution you can mark as solution and gives kudos)

     

    Thanks & Regards

    Vishnu Reddy

  • Sormick Profile Picture
    566 on at

    Hello @VishnuReddy1997 ,

    Sorry but i'm using the French version of Power app.

    Please find my screenshot below

    1.jpg

    I have a workbook named like this: "EXPORT554545.CSV" which is already opened.

    I need to take control of this workbook by its partiel filename "EXPORT*.CSV" because sometimes i have another workbook opened but with different filename with other digits "EXPORT885533.CSV" 

    Hope this helps.

     

     

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    When you launch Excel, all actions in that Excel belong to %ExcelInstance%; as long as you don't point %ExcelInstance% at another Excel, so if you are running on Excel actions, then it shouldn't change.

     

    Therefore, like @VishnuReddy1997  said below, use Get Files to choose your file and Launch from Get Files.  There has to be some logic to sort out your old file vs new file.

     

    Good luck!

  • VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @Sormick ,

     

    If you use focus window to focus that excel is enough as shown in below image.Irrespective of name of excel it will take the instance and focus that excel.

    Please find the below solution.

     

    VishnuReddy1997_0-1714536214000.pngVishnuReddy1997_1-1714536229886.png

     

    (Note:- if you got your solution you can mark as solution and gives kudos)

     

    Thanks & Regards

    Vishnu Reddy

  • pradeepvarma Profile Picture
    55 on at

    Another alternative is to use the below activity to get the exact file name with the partial name what you have:
    Get files in foler

    In the above activity if you give Export*.xlsx, it would fetch all files with that name in that folder and use the file for further processing as you need.

     

    If it works for you, kindly mark it as a solution.

     

    Regards,

    Pradeep Varma

    Follow on LinkedIn

  • Sormick Profile Picture
    566 on at

    Hi @VishnuReddy1997 ,

     

    Sorry for my late reply.

    Please note that i only need to get the focus of the requested file whch is already opened. I don't need to open it again.

    I managed to get the full path of the requested file with this:

    • Get files in folder with this filter: "export*"
    • For each currentitem in files
    • Focus Window
    • End 

    The issue i have now is that i don't know how to get the focus of this file. it doesn't work with the full path using the variables Currentitem or using Files.

    Any suggestion?

     

  • Verified answer
    VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @Sormick ,

     

    To focus the excel file use Focus window action as mentioned below.

    I have created the similar flow.Please find the solution

    VishnuReddy1997_0-1715764542097.png

     

    Code:

     

    Folder.GetFiles Folder: $'''C:\\Users\\OneDrive\\Desktop\\Power Automate Desktop\\Projects\\BOM Costing\\Templates''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
    LOOP FOREACH CurrentItem IN Files
     SET ToFocusFileName TO $'''%CurrentItem.NameWithoutExtension% - Excel'''
     Text.Trim Text: ToFocusFileName TrimOption: Text.TrimOption.Both TrimmedText=> ToFocusFileName
     Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: CurrentItem.FullName Visible: True ReadOnly: False Instance=> ExcelInstance
     WAIT 2
     UIAutomation.FocusWindow.FocusByTitleClass Title: ToFocusFileName Class: $'''XLMAIN'''
    END

     

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

  • Sormick Profile Picture
    566 on at

    Thank you so much!

    This flow works perfectly!

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
11manish Profile Picture

11manish 275 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 235

#3
David_MA Profile Picture

David_MA 178 Super User 2026 Season 2

Last 30 days Overall leaderboard