[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


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

Posted on 2014-08-04
Medium Priority
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 ctl_checkBox.top = 34), unload the form, and re-initiate it.
But recently, I find that some properties like ctl.top 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

Zack Barresse earned 2000 total points
ID: 40240256
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

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

867 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