I've encountered something odd and need a workaround.
We're trying to help end users set up their own ProcessBooks with some standard components, so I created a userform that has MS Forms textbox input fields whose values are used to set the attributes of some Symbols. The userform also has a Forms command button whose _Click event executes the ThisDisplay.Symbols.Add(appropriate symbol type constant) method. The user form needs to be non-modal so the users can interact with the Display before and after creating the Symbol.
This works fine if the Symbol being created is a circle (Ellipse) or a Rectangle. However, when a Bar or a Value is being created, the strange behavior occurs. When the userform's command button _Click event runs and adds the Bar or Value, the userform closes immediately after the _Click event code finishes executing. Tracing through the code, it's the execution of the .Add statement that triggers whatever is causing the problem, but the userform doesn't close until the _Click event sub finishes executing.
I've tried playing with other userform events, but haven't found anything that can keep this from happening. It's a pain, because the user needs to be able to copy some information that's being displayed on the userform after the Symbol is created, but the form closes before they have a chance. Also, they would have to re-enter a lot of the same information to set up the creation of the next Symbol, because what they had entered goes away when the form closes.
If the userform is set to .Showmodal = True, then even for Bars and Values, the userform stays open after the _Click event code complets, but that means the users can't interact with the Display because the userform is Modal.
Anyone seen this behavior, know what's causing it, or much better, know a way to keep it from happening?
Thanks for any insights!
James