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 / Unable to execute VBA ...
Power Automate
Answered

Unable to execute VBA for the second time and thereafter

(0) ShareShare
ReportReport
Posted on by 385

It happens in the same place every day. When I use the PAD to execute the Excel VBA button, an error occurs the second time or after that. The strange thing is that there is no problem if I execute it manually or skip the next step. What is the reason?

螢幕擷取畫面 2024-04-03 164026.png螢幕擷取畫面 2024-04-03 164026a.png

I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @alee001 

    What is the specific error message? Could you please provide a translation?

    Meanwhile, please refer to the following link for troubleshooting in case it's a code execution issue.

    Code execution has been interrupted | Microsoft Learn

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Can it be that your file name changes? Which action does it fail on? What's the error message?

  • CU31080729-3 Profile Picture
    502 Moderator on at

    Hi,

    Are you execute or run VBA by clicking on this button by using click on it 

    can you provide more details about your scenario.

     

    (Note:- if you got your solution you can mark as solution and gives kudos)

     

    Thanks & Regards

    Chetan Ninghot

  • alee001 Profile Picture
    385 on at

    Thanks for the reply,

     

    There is no error message because I set up to redo step 12. I can only forcefully terminate the process and then re-execute the process to pass.

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @alee001 

     

    The retry mechanism is okay, but I'm attempting to understand the specific error being thrown before the retry mechanism kicks in. Therefore, if feasible, let's temporarily disable the retry mechanism in the error handling process and capture the exact error being thrown.

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • alee001 Profile Picture
    385 on at

    The following is the process background,

     

    The process is to operate 20 identical VBA files (01~20), each file has a sequence of button input settings to perform backtesting.

     

    The problem occurs in step 20, because sometimes a file in the batch file will have an interruption error message and cannot be pressed, so you need to set a retry button to continue the process, but each process can only be completed successfully the first time, and the second or subsequent times. Problems will arise when executing the process.

     

    The retry mechanism keeps pressing the button so no error message appears and the process can only wait or forcefully terminate the process.

     

    There is no problem with the manual operation of the VBA button in step 20. However, the VBA error message appears when the PAD is executed.

     

    Is this a VBA compatibility issue or a PAD bug?

  • CU31080729-3 Profile Picture
    502 Moderator on at

    Hi,

    It is not vba compatibility issue , but while running the process you have got some issue or error can you provide exact what kind of error occurs .

    In your process you are clicking on button on excel for executing the vba process its may be compatible for click on button .

    my suggestion for it if possible to all vba button or process code in one vba excel file , for that you can execute your all vba process by run excel macro action by using that you does not required to click on each vba button.

     

    (Note:- if you got your solution you can mark as solution and gives kudos)

     

    Thanks & Regards

    Chetan Ninghot

      

  • alee001 Profile Picture
    385 on at

    This is not a problem with the VBA file itself, because no matter how many times you manually execute all buttons of each file, there are no VBA errors at all. Each button has its own set of codes to execute, instead of using a bunch of codes for multiple buttons.

     

    If it is not a bug, why can the PAD process only be executed for the first time?

  • alee001 Profile Picture
    385 on at

    Every time I execute the process for the second time, a VBA error occurs. Each time, there are only two solutions:


    1) Press End in the VBA error message, and then manually press the button on the worksheet again to continue the process.


    2) Terminate the PAD process and re-execute the process.

     

    For no apparent reason, only the first VBA button had problems executing the second process, but the other VBA buttons had no problems.

  • JeffreyDSmith Profile Picture
    69 on at

    I must restart my PC each time after using PAD. Sometimes, PAD screws up my macro-enabled Excel so badly, that I have to delete it and restore from back-up copy. (I keep several back-up copies.)

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 612

#2
Valantis Profile Picture

Valantis 344

#3
11manish Profile Picture

11manish 326

Last 30 days Overall leaderboard