+ Reply to Thread
Results 1 to 6 of 6

Form Button vs ActiveX Button Performance

  1. #1
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Form Button vs ActiveX Button Performance

    Hello
    I have a macro that when run with a Form button completes in about 5 seconds. If I run the same macro via an ActiveX button, it takes about a minute.
    With the Form button I choose the macro to run through the menu. With the ActiveX I have Application.Run "ModuleName.MacroName"
    Any idea why this would be?
    Thanks
    Last edited by Philb1; 09-07-2013 at 06:36 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Form Button vs ActiveX Button Performance

    Hello Philb1,

    There could be several causes but without seeing the code, I can't really say. Posting your workbook for review would be the best option.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Form Button vs ActiveX Button Performance

    Hi Leith.. I've tried calling the macro, using shapes & assigning the macro to them with no luck. Repair opened the file & found the file grew from 1.9mb to 2.2, not sure why that would be. Googled & found others have had the same problem & it seems like there's no fix. 2010 seems to be a bit of a problem child for MS.
    I'll use the form button. The only reason I was going to use the ActiveX control was to pretty it up a bit.
    I could understand it if I was running different macros, but the exact same code, the only difference being the button the command came from. Dunno

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Form Button vs ActiveX Button Performance

    If you post the code then we can have a look, I'd be surprised if using an ActiveX button on a sheet really makes the difference, I suspect the issue is elsewhere. That said, it would be a cold day in hell before I'd put an ActiveX button on a sheet when there's a form alternative.

    As an aside, 2010 is infinitely better than 2007 - that was horrendous

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Form Button vs ActiveX Button Performance

    It's not a regular way to start a macro in an activeX contol using the Application.Run "ModuleName.MacroName" method.
    Referring to the macromodule isn't either.



  6. #6
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Form Button vs ActiveX Button Performance

    It appears that when you fully qualify every command and reference in the macro, the problem goes away. The other things I noticed are the workbook save time reduces by at least half & the file size shrunk.
    All is well

+ 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. Hide a picture button placed in all sheets using a option button (form control)
    By lagaranch in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-26-2012, 10:33 AM
  2. Replies: 2
    Last Post: 11-16-2012, 04:35 AM
  3. [SOLVED] Change Background color of a Form Button or ActiveX Button
    By Aeneren in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-11-2012, 12:19 PM
  4. VBA User Form - Linking Close Button and Cancel Button
    By nivassrii in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-26-2011, 07:05 AM
  5. Command Button vs Form Button
    By Bri in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2006, 04:25 AM

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