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 / Can't access UI elements
Power Automate
Answered

Can't access UI elements

(0) ShareShare
ReportReport
Posted on by 53

Hi,

 

I've been trying to run an application to my flow (Notepad ++), but it doesn't work.  If I use send mouse click, nothing happens, the flow still runs but there is no error message. But when I used Click UI element, I receive this message:

 

julian1994acuna_0-1690531657233.png

 

I tried running PAD as admin, but it still does not work. I tried running Notepad++ as admin, but does not work as well. How can I use Notepad++ on my automation? Just to add more info, I'm using Notepad++ on a csv file to remove commas at end of each line. When I open the csv file on excel, it does not show. 

 

Thanks in advance

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

    Hi @julian1994acuna 

     

    One thing to remember, Comma Seperated File (CSV) file does not show the commas when file is opened in excel, the comma would be serving as delimiter for columns.

     

    Regarding the automation, i would suggest to do string manipulation instead of UI Automation on notepad ++. The way to do would be like this:

     

    1) Read the text file 

    2) Replace the ending commas for each line with ''

    3) write the updated text back to excel.

     

     

    Hope this helps !

    Mark it as solution if it resolves your query 🙂

     

  • julian1994acuna Profile Picture
    53 on at

    Hello,

     

    Thank you for the suggestion. I think this will do. Now my only problem is how can I replace the ending commas only to make sure that the other commas are not affected. Only the end of each line.

     

    Thanks in advance 

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

    The easiest way to do that would be to use Replace text with a regular expression pattern that replaces commas that are either followed by a newline or are at the end of the string.

     

    You can use the following code to copy and paste to your PAD flow and the actions will be automatically created for you:

    SET FilePath TO $'''C:\\RPA\\Test.csv'''
    File.ReadTextFromFile.ReadText File: FilePath Encoding: File.TextFileEncoding.UTF8 Content=> FileContents
    Text.Replace Text: FileContents TextToFind: $''',(?=(\\r?\\n)|($))''' IsRegEx: True IgnoreCase: False ReplaceWith: $'''%''%''' ActivateEscapeSequences: False Result=> Replaced
    File.WriteText File: FilePath TextToWrite: Replaced AppendNewLine: True IfFileExists: File.IfFileExists.Overwrite Encoding: File.FileEncoding.UTF8

    What it does is as follows:

    1. Reads the text from a CSV file located at %FilePath% (you will need to provide the correct path to your file in this variable);
    2. Replaces all commas that are either followed by a newline or are at the end of the entire string with nothing;
    3. Writes the result into the same file.

    Try this and see if it works for your case.

    -------------------------------------------------------------------------
    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.

  • julian1994acuna Profile Picture
    53 on at

    Hi Agnius,

     

    It worked. But not 100% on my end. Apologies if I'm not that clear on my scenario. So what really happened is it did remove the comma, but there are still commas remaining. Each line there are 1 to 5 commas. So I need to remove all the remaining commas at the end of each line. Not just one. Is that possible?

     

    Thanks!

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Are you sure you want that in a CSV file? Several trailing commas in a comma-delimited CSV file indicates empty fields. If you remove them from some lines, but not all of them, the structure of the file will break, because it will contain different numbers of fields in different rows.

  • julian1994acuna Profile Picture
    53 on at

    Yes. As this is the file format the I'm following for my project. I am able to do this on notepad++ but I wanted to try this approach if possible. Is that still doable?

    This is a sample file that I need to fix

    julian1994acuna_0-1690784206080.png

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You can use the same code but adjust the regex pattern to this: ,+(?=(\\r?\\n)|($))

     This will replace one or more commas that are followed by a new line or the end of the string.

    -------------------------------------------------------------------------

    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.

     

  • julian1994acuna Profile Picture
    53 on at

    Hi Agnius,

     

    I tried replacing it and able to run without errors. But nothing has changed when compared to the original file. I just copied and paste the new pattern. Did I do something wrong or missed something?

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

    I included too many backslashes in the pattern when I copied it from the code above. Try using this instead: ,+(?=(\r?\n)|($))

    -------------------------------------------------------------------------

    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.

     

  • julian1994acuna Profile Picture
    53 on at

    Hi Agnius,

     

    It worked!!! Thank you so much!

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 233 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 227 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 178

Last 30 days Overall leaderboard