Issues with modal UserForms and Inventor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey,
I'm having this problem since forever, so I'm asking for advice.
I'm using a modal userform to display output of my macros. The form is just a simple form with a large textbox and vertical scrollbar, a close button and a progress bar (self made).
The problem is, I need to show this form modal for certain macros, to prevent users doing anythign with the currently open document while the macro is doing it's things. The macros output sort of logging information into the textbox, and it should automatically scroll. But sometimes these macros take a looooong time to run. Sometimes even Windows7 thinks the inventor application is hung and not responding because the macros working. In these cases the modal userform disappears and goes behind the inventor window. Also, after this happens for the first time, the textbox stops scrolling completely and even though any text input to teh userform should bring it to foreground and give it focus (which is apparently required for the text scrolling to work), it does not work either.
The only thing I could do is, to put some DoEvents calls into the macros. This makes inventor "repsonsive" again and makes the textbox scrolling too. But the problem is, doing taht also defies the modality of the form and the user interaction events is taken by inventor and they do can manipulate teh open documents despite an open modal form.
So long story short: is there a better or recommended way to fix this?
Thanks.
IV2018.3.6, W7 x64.