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 error handling ...
Power Automate
Answered

How to error handling when I run Excel Macro

(0) ShareShare
ReportReport
Posted on by 73

Hi, All

 

I try to use an Excel Macro which includs the following code.

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

With Application.FileDialog(msoFileDialogFolderPicker)
    .title = "Choose Folder"
    .InitialFileName = "C:\Users\FLC004\Desktop\PDF"
        If .Show = 0 Then
            MsgBox "Interruption"
            End                                    ←←←
        Else
            myfolder = .SelectedItems(1)
        End If    
End With

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

When I use "Run Excel Macro" ,  the process  goes through "End"(←←←part), nevertheless FileDialog is shown again.
I click "cancel" again and the error occurs(cf: attached file).

Do you know how to address this situation?error.jpg

 

I have the same question (0)
  • Verified answer
    MichaelAnnis Profile Picture
    5,727 Moderator on at

    With the adoption of Power Automate, we have removed any dialogue/message boxes from our Macros.  As an alternative, we have proceeded to fill in necessary information elsewhere in the workbook, such as on an "Input" tab.

     

    This allows a person manually running a process to simply fill in the information, and if PAD is doing it, then it can use the %Folder% variable to populate the cell prior to running the Macro.

  • Miyuki Profile Picture
    73 on at

    Hello, Michael

    Thanks for your quick reply and I'm sorry for the late response.
    (I couldn't input and click on this site due to Internet Explorer. Now I realize that this site adapt Microsoft Edge😓.)
    I understand that I need to remake my Macro or PAD.

    Miyuki

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 464

#2
Haque Profile Picture

Haque 431

#3
David_MA Profile Picture

David_MA 323 Super User 2026 Season 1

Last 30 days Overall leaderboard