VBA: Problem after closing userform

Kierewiet

New Member
Joined
Mar 25, 2013
Messages
4
I have an userform in Excel with an Micrsoft Web Browser in it to show a html-file.

This userform works fine but my problem occurs after closing this userform while I have multiple workbooks open in the background. After closing the userform I lose control over selecting different workbooks in the taskbak.

I find it hard to explain so I posted a (simplefied) example of my worksheet with a step-by-step tutorial to reproduce my problem:

Link to the file:
Code:
http://www.yourfilelink.com/get.php?fid=834842

Step-by-step tutorial:
1. Open the example
2. Open a new empty excel-workbook
3. Click in the example on the button "Maak grafiek"
4. The userform "waferoverview" appears. Close this userform with the cross in the upper right corner
5. In the taskbar, try to select the empty workbook which you created in step 2

I can click to show this file but it isn't appearing on my screen. Even when I click to show another application and want to switch back to Excel via the taskbar, this isn't possible anymore. The only way to show Excel again is by minimizing the other appplication.

Can anybody explain me why this problem occurs?

Thanks in advance.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Thanks for your reply.

That is because you probably don't have a file named "test.html" on a partition named "Q:". But to illustrate my problem you won't need that file because I don't have any problems with viewing that file.

Just follow the step-by-step tutorial and you will find out what i mean ;)

Edit: If you like, you can change "Q:/test.html" to "http://www.mrexcel.com" or something like that to show that it's not the HTML file which occurs the problem ;)
 
Last edited:
Upvote 0
I tested in 2010 and 2013 (skipping that line of code) and there were no problems.
 
Upvote 0
@RoryA
The problem won't happen when you skip the line. You have to navigate to a site or file (this is also new to me) :)

@Andrew Poulsom
You're right! This gave a member on an other forum an idea and came up with this code:

Code:
Private Sub UserForm_Initialize()
    WebBrowser1.Navigate "http://pixcels.nl/"
End Sub


Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    Application.ShowWindowsInTaskbar = False
    Application.ShowWindowsInTaskbar = True
End Sub

This is a good workaround for my problem! Not that my problem is solved with this but I can work normally with Excel again when using this macro.

Thanks for your help.
 
Upvote 0
Please check the forum rules on cross-posting and provide links to your other posts in future. Thanks.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top