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 / Check whether excel fi...
Power Automate
Suggested Answer

Check whether excel file is opened

(1) ShareShare
ReportReport
Posted on by 2
Hi, is it possible to check whether an excel file is already opened?

otherwise if my flow starts with launching excel and the file is already opened the flow crashes right away.
 
so basically I wanted to do a if not opened, then launch, if already opened, skip to next step kind of flow.
 
thanks in advance!
I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,549 Super User 2026 Season 1 on at
    You can use "If process" to check if "EXCEL" process is running. Then you Terminate it or try to attach the excel if the name is already known to your flow.


    Or you could first try attaching the Excel and if it isn't able to do so then use Launch Excel.


    Attach to running Excel on error:
  • SARAVANA PRABHU R Profile Picture
    16 on at
    Yes, you can implement a check for whether an Excel file is open before launching it in Power Automate. Here's a general approach you could use:
     
    1. Use PowerShell or a Script in Power Automate:
       - You can add a PowerShell script to check if an Excel file is open. If the file is open, PowerShell will return a specific value, which you can use in a conditional step.
       - If the file is not open, the script will return a different value, triggering the launch step in your flow.
     
    2. Example PowerShell Script:
       - This script checks if a specific Excel file is open:

        $filePath = "C:\Path\To\Your\ExcelFile.xlsx"
         $excel = Get-Process | Where-Object { $_.ProcessName -eq "EXCEL" }
         if ($excel -and (Get-Process | Where-Object { $_.Path -eq $filePath })) {
             Write-Output "Open"
         } else {
             Write-Output "Closed"
         }

       - Save this script as a `.ps1` file and run it in your Power Automate flow. If it returns "Open," you can skip launching Excel.
     
    3. Set Up Power Automate Condition:
       - After running the PowerShell script, use the output to set up a condition in your flow:
         - If the output is "Open," skip the "Launch Excel" action and proceed to the next step.
         - If the output is "Closed," then launch Excel.
     
    This approach will help you avoid crashes by confirming the file's status before launching it.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 382

#2
Valantis Profile Picture

Valantis 370

#3
David_MA Profile Picture

David_MA 300 Super User 2026 Season 1

Last 30 days Overall leaderboard