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 / Opening an Excel that ...
Power Automate
Answered

Opening an Excel that has just been copied

(0) ShareShare
ReportReport
Posted on by 32

Hello everyone,

 

I'm trying to build a flow where I can copy data from a CSV file into Excel.

Reading the data out of CSV works fine, my problem is that I copy an Excel and want the data in this Excel. After I have copied the Excel and renamed it, I would like to open it. Then I get this error message:  Index "1" (or "0") is out of range.

theresa0501_0-1697116819893.png

 

theresa0501_2-1697117006290.png


(If you are wondering why the 1 (or 0) is there, without it PAD does not detect RenamedFiles as a file which can be opened - I got it from the community here)

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @theresa0501 

     

    Could you check RenamedFiles variable?

    Does it have only one item ? if it has only one item, then use %RenamedFiles[0]% instead of %RenamedFiles[1]% as array index starts from zero not from one.

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Indexes are 0-based in PAD. So, if you have only renamed a single file, you should use %RenamedFiles[0]% as the file to launch.

    Also, you should make sure that your Rename file(s) action actually renames the file. Make sure you set it to "Overwrite" if the file exists already. 

    Agnius_0-1697127441191.png

    By default, this is set to "Do nothing", meaning that if a file with the same name already exists, the target file will not be renamed. When that happens, %RenamedFiles% will be empty.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • theresa0501 Profile Picture
    32 on at

    I think the problem was with overwriting. 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
11manish Profile Picture

11manish 249 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 202

#3
David_MA Profile Picture

David_MA 180 Super User 2026 Season 2

Last 30 days Overall leaderboard