Consulting

Results 1 to 3 of 3

Thread: Keeping modeless userform on top

  1. #1

    Keeping modeless userform on top

    Hi,
    I have a macro that opens an external workbook and does some processing to it. I am using a modeless userform to notify the user on the progress of the macro, and also to enable the user aborting the macro.
    My problem is that the userform is constantly being sent to the back (i.e. disappears) and pops up again during the execution if the database is very large and the macro needs to run for a long time. Also, the cancel button that I put on the userform is not very effective because it takes a long time to respond, if at all (of course it cannot work if the userform is hiding behind the workbook...).
    I tried using DoEvents as was suggested in other threads on this topic, but it doesn't seem to be very reliable.
    If necessary, I am willing to use the status bar instead of the userform to indicate progress, but what can I do to make the cancel button work effectively?

    Thanks,
    Chen

  2. #2
    Excel 2013 and later have a new way of working with workbook windows, which means a userform is parented to te workbook tha called it. Any other workbook you activate will show up on top of the userform. I devised a way to overcome this here: http://www.jkp-ads.com/articles/keepuserformontop.asp
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  3. #3
    Thanks! I'll give it a try

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •