+ Reply to Thread
Results 1 to 4 of 4

macros run slowly with "ActiveX Button", but run faster with "Form Control Button"

  1. #1
    Registered User
    Join Date
    08-10-2017
    Location
    Brussels
    MS-Off Ver
    2016
    Posts
    2

    Angry macros run slowly with "ActiveX Button", but run faster with "Form Control Button"

    I have a problem of macros running very slowly, with something very strange!

    When I click on ActiveX Button1, it takes for instance 15 seconds to accomplish the following macro :

    Please Login or Register  to view this content.
    The behavior is the same when I run CommandButton1_click() from VBEditor by pressing [F5] key!



    Instead, in the same sheet, I created a "Form Controls" Button that launches the same macro "CommandButton1_click" and now it takes only 2 seconds to run the macro...



    That can be a solution for some of you to improve the execution speed of macros.


    Unfortunately, We can't apply this method for all slow macro.

    I'd like to find the cause and a solution of:

    Why the same macro runs slowly when I click on a "ActiveX" Button (or [F5]) and runs faster when I click on "Form Controls" Button ? very wierd
    Last edited by darigh; 02-10-2024 at 06:10 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,757

    Re: macros run slowly with "ActiveX Button", but run faster with "Form Control Button"

    Welcome to the Forum darigh!

    This is not normal behavior. We cannot diagnose this without an example. Please see yellow banner at the top of the page and attach a sample file that has both buttons and displays the behavior you are describing, with actual code.

    Also, can you tell us something about the platform you are running on? What version of Windows are you using? What is the CPU, and what is the physical memory size for your computer?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    08-10-2017
    Location
    Brussels
    MS-Off Ver
    2016
    Posts
    2

    Re: macros run slowly with "ActiveX Button", but run faster with "Form Control Button"

    hello,
    hereby a sample XLSM file that shows my problem of execution speed with "ActiveX Button" vs "Form Control Button"


    timelipse ActiveX or FormControls.png


    I checked on 3 different computers
    Laptop HP ZBook i9 32GB Ram 1TB Nvme with W11 23H2 + Office 2019
    Desktop HP Omen i9 64GB 2TB Nvme with W11 23H2 + Office 2019
    Laptop Lenovo Carbon X1 i7 32GB 1TB Nvme W11 23H2 + Office 2021
    ...Same problem on each machine

    Thank you for your Help
    Attached Files Attached Files

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,757

    Re: macros run slowly with "ActiveX Button", but run faster with "Form Control Button"

    Both buttons took about the same amount of time. The Time function is not precise to more than 1 second but you can see these were within 1 second of each other. I modified the code slightly so I could include in the output which button was clicked, and to calculate the elapsed time.

    So I am unable to reproduce your issue.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 01-09-2019, 02:15 PM
  2. VBA to click the "Open" or "Save" button in Internet Explorer Dialogue Box
    By kimvyp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2019, 12:22 AM
  3. Replies: 15
    Last Post: 09-05-2017, 07:35 PM
  4. [SOLVED] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  5. Replies: 1
    Last Post: 06-09-2014, 04:11 AM
  6. Replies: 1
    Last Post: 10-23-2013, 05:20 PM
  7. Replies: 2
    Last Post: 11-16-2012, 04:35 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1