+ Reply to Thread
Results 1 to 4 of 4

Form Controls - Save property changes set at Runtime?

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Form Controls - Save property changes set at Runtime?

    Slightly unusual question.

    Imagine I have a form with a few controls on it. And the controls properties are set up at runtime.

    Is there any way possible to save the property changes that were made at runtime to the controls themselves? I mean - short of manually editing all the controls at Design time?


    This might be easier to explain by example. See dummy code below. Using this example - I want to find something that will save the Caption of CommandButton1 as "TestMe" (rather than have it only temporarily set at runtime)
    Please Login or Register  to view this content.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,411

    Re: Form Controls - Save property changes set at Runtime?

    You can store the information somewhere and read it back when the form is next loaded.

    There are many places to store the information.
    Worksheet
    Custom document properties
    CustomXMLParts
    Named ranges
    External text file
    Registry

    Or you can write code to update the controls directly.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Form Controls - Save property changes set at Runtime?

    Quote Originally Posted by Andy Pope View Post
    Or you can write code to update the controls directly.
    Brilliant Thank you very much Andy Pope. +1


    Without wanting to appear ungrateful - I was thinking more of something that would save all of the controls properties at runtime - without having to add a line of code for each property you want to save. But it doesn't matter. I can use the example you have provided as a guide to create the form I was looking at converting in my previous thread. It will save me a lot of work.

  4. #4
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Form Controls - Save property changes set at Runtime?

    Thanks to Andy Pope, I have proven this to be very useful

    e.g. batch changing the name formats of controls. Example below:
    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. [SOLVED] Found missing 'Move and Size With Cells' property for Form Controls!!
    By RickW1221 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-28-2020, 10:19 AM
  2. Replies: 1
    Last Post: 05-01-2014, 05:15 PM
  3. Runtime error 381: Could not set the list property.Invalid property array index
    By rohith4prithvi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-23-2014, 10:24 PM
  4. How to disable a form or controls at runtime
    By noclass1980 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-24-2012, 12:47 AM
  5. Runtime Error 380 – Could not set the list property. Invalid property value
    By BernzG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2005, 05:10 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