excel dynamic user form: sometimes form does not update recently changed object property

Posted on 2014-08-04
Last Modified: 2014-08-05
I have a vba user form where 95% of objects are defined dynamically. It's quite a big form
When adjusting layout, I change an object property in CODE  (eg = 34), unload the form, and re-initiate it.
But recently, I find that some properties like and ctl.caption do not update their display according to the  NEW property value specified in the code (above).

At first I thought I was editing the property of wrong object (hence no change rendered to obj on screen).
However, I found that if, before making the DESIRED change in property, I first set the property to NULL (for .Caption) or a way-out different value for .Top (etc), THEN I got the desired change in property that was specified in the very next line of code.

It seems as though the Form ignored small changes (during editing), and needs a 'jolt' to wake up and take me seriously! Can you give me some top-ideas of possible causes, please. So I can probe about..

Is there some probable rationale to this? Is this phenomenon 'telling me something' about an error in my approach to dynamic form creation? - I've created many before, but not quite so big.

Thanks, Kelvin
Question by:Kelvin4
    LVL 14

    Accepted Solution

    Hi there,

    In re-creating the form, you might want to think about using the userform.Repaint method to ensure the controls show updated settings. Besides that I haven't heard of a specific issue of why this would be happening.

    Zack Barresse

    Author Closing Comment

    Thanks, Zack,
    That's new to me and very helpful. I'll see how I get on!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
    Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
    The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
    This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now