PDA

View Full Version : [SOLVED:] Userform doesn't open unless Excel is the active application



dkaydkay
04-02-2014, 05:14 PM
Did a search and can't find a solution. I have a workbook that processes cells and then opens a userform with a countdown timer to allow the user to cancel before the data uploads to a server. Everything runs fine if the macro is called and the user stays in excel the whole time.

But if the user starts the macro, then goes to another application before all the cells are done processing, the userform doesn't open and the timer doesn't start.. until the user clicks back on Excel. Is there a way to force the userform to open even though Excel isn't the active application?

Thanks in advance!

SamT
04-02-2014, 07:25 PM
Need to see all your code to process cells and run the form.

Jan Karel Pieterse
04-03-2014, 12:32 AM
You could use some API calls to force the userform to be on top of all windows:
http://www.jkp-ads.com/articles/keepuserformontop.asp
Note that you would have to remove the version check that is in the example code...

dkaydkay
04-03-2014, 06:50 AM
Thanks for the help. I made the userform modeless and it works. I thought that was the first thing I tried a month ago. But it works now. Thans Jan and SamT