web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / I am getting errors wh...
Power Automate
Unanswered

I am getting errors when writing to Excel worksheet.

(0) ShareShare
ReportReport
Posted on by
Hello,
Sorry for my terrible English.
 
I was asked to do this by a distant friend. 
Despite it running successfully in my environment,  it fails in his environment.
His OS is Windows 11, and PAD is the latest version, exactly the same as mine.
 
I’m using two flows, main and sub, and the process flow is briefly described below.
 
Main
  • User chooses a folder, say InputDirectory
 
Sub
  • Launch Excel
  • Find xlsx files in InputDirectroy and open them in a loop
  • Store the first column data of each xlsx file in a list variable “List”
  • Remove duplicates in the List
  •  Write List to a blank Excel worksheet(Error occurs)
 
An error occurs at the very end of the sub-flow.
So, I created the following flow and had it run in a friend's environment. Then, no error occurred.
 
Experiment
  • User chooses a folder
  • Launch Excel
  • Write “test” to Excel worksheet
  • Save the Excel document
 
Why do errors occur in his environment that do not occur in mine?
Also, why do errors sometimes occur when writing to an Excel worksheet in his environment and sometimes not?
 
Attached is an image of the error. Thank you.
スクリーンショット (1) (1) 1 (1).png
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    Hm... maybe related:

    I hade two Excel files: extracting data from one and doing some calculations on the date before writing to a new Excel file. Sometimes they it would fail.

    After some detective work I found out that the second Excel application  sometimes did not have forcus on wrtiting dat to it. Instead the data would be written to any application that got focus.

    The solution was to make sure that I had oExcelSource and oExcelDestination objects instead of using "Foreground Window".

     

    Maybe your friend has some software that takes focus from your flow.

    And the usual should be observed: 

    • same locale/interational settings
    • RAM
    • access rights

    Hope it helps a bit.

     

    Best regards

    /Klaus

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard