+ Reply to Thread
Results 1 to 6 of 6

Is it better to use Active X controls or shapes with Macros attached

  1. #1
    Registered User
    Join Date
    10-24-2012
    Location
    Guelph, ON
    MS-Off Ver
    Excel 2010
    Posts
    41

    Is it better to use Active X controls or shapes with Macros attached

    Hello: This is a general question regarding best practices or how to optimize performance. Hoping someone will have insight based on past experience because Microsoft support has not been helpful.

    I have a large workbook that has 10 tabs in it that contain several activeX checkboxes. As you click on the boxes rows unhide with more options for checkboxes, data entry etc. Each sheet is identical in that each sheet is used to define settings for a "room". It works beautifully. However, now we want to set this up to give us 25 "rooms". If I create a total of 25 the spreadsheet no longer works. I can open it but the boxes, etc. won't load properly and the spreadsheet looks mostly blank because the pictures (from the controls) can't be displayed. I suspect it's due to the resource intensity of these controls.

    What I'm looking to confirm is that I could replace the checkboxes with shapes to click on instead but not sure if this will solve my problem. I feel like shapes might be a bit less resource intense because I can assign the macros at a module level vs. private. So if each tab/room has 60 active x checkboxes, I currently have 60x10 sheets =600 little macros saved. If I use a shape I can refer to a macro in a module and only have 60 (vs. 600).

    Does this sound reasonable? Asking first because it's a LOT of work and time to change this and figured the smart folks in here might know.

    Thoughts or even other suggestions for best practices here would be appreciated.
    Attached Files Attached Files
    Last edited by SCarroll; 08-03-2023 at 09:43 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,943

    Re: Is it better to use Active X controls or shapes with Macros attached

    Being realistic, I can't answer your question.

    But . . . have you thought about ditching all the Active X Controls and just using Event handlers. First thought was to use a Worksheet Selection Change Event handler but that might be too easy to fire inadvertently.

    Maybe better to use the BeforeDoubleClick event handler. For example:

    Please Login or Register  to view this content.
    Or you could even use the Workbook.SheetBeforeDoubleClick event handler and put the code in one place. That should work well and minimise the code if all the sheets are structured in the same way.

    See: https://learn.microsoft.com/en-us/of...oredoubleclick

    Anyway, just a thought. It should reduce the resource requirement dramatically. Maybe not as pretty. But, using fonts, fill colours and borders, you could simulate a Button without the overhead.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: Is it better to use Active X controls or shapes with Macros attached

    see big yellow banner - upload a workbook - there has to be a simpler way than replication.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  4. #4
    Registered User
    Join Date
    10-24-2012
    Location
    Guelph, ON
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Is it better to use Active X controls or shapes with Macros attached

    I've attached a much older simplified version of what I'm working with but it gives you an idea of what I'm trying to do. My current sheet that is completed with 10 rooms is extremely large and I have info in there I can't share publicly so was just wondering if there were some thoughts around this. However, this early version from a few months back (early in development) should give you the idea of what I'm trying to accomplish but with many more categories and check boxes on each room and we want to get this to 25 rooms total. Hopefully this is more helpful.

    Thanks.

  5. #5
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: Is it better to use Active X controls or shapes with Macros attached

    Instead of constructing all those individual room sheets why not consider using 'bespoke' userform with multiple layers of 'multipage pages'.
    This can be self-constructing 'on the fly' or individually tailored to suit each room, there should be no need to have a 'quotation form' full of formula.
    To save the quotation data you only need a primary key reference, followed by a secondary key referencing your items table, followed by a quantity - you then pull the data into 'quotation' by code.
    This is far faster than having a sheet full of formula where 75% may contain nothing (if you wish to continue using the quotation using formula, consider using a structured table (as you add your next row your formula will dynamically expand).
    Attached is a solution I posted on this site a few years ago (although it is Swiss/German - the basis was the enquirer needed a means of registering all details of properties in a rental portfolio).
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-24-2012
    Location
    Guelph, ON
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Is it better to use Active X controls or shapes with Macros attached

    Thank you for that idea! I will explore it for sure!

+ 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. [SOLVED] Using shapes and image and form controls rather than activex
    By Undo in forum Excel General
    Replies: 5
    Last Post: 04-22-2023, 08:37 AM
  2. [SOLVED] Can you use shapes as an interactive filter, similarly to Form/Active X controls?
    By MushroomFace in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2020, 12:03 PM
  3. Connecting Shapes with Arrowed Lines - Debugging help! - Code attached
    By Snaybot in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-13-2016, 04:42 AM
  4. Replies: 0
    Last Post: 06-09-2015, 09:30 PM
  5. Form Controls / Active X controls to record and log information in a seperate sheet
    By marcbarnett in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-09-2014, 05:00 AM
  6. Replies: 1
    Last Post: 12-03-2012, 08:55 AM
  7. Disabling shapes and controls
    By Jonathan Orgel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-01-2006, 01:00 PM

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