excel hangs when trying to 'close' with a webbrowser control in a user form

rny1mrxl

New Member
Joined
Jun 17, 2011
Messages
15
folks,
I found a write-up on the webbrowser control to use with excel vba, read it, just what I needed i thought.


I have it in a user-form, just learning, and I used the ‘initialize’ routine and then added a list box and a combo box. then i found a problem:


1. All the controls I put in work as intended
2. But if I close the excel workbook [using excel2016], excel ‘closes’ but after the workbook contents disappear, excel itself hangs forever [I need to kill excel in the TaskManager]


It occurs to me that maybe the webbrowser control ‘doesn’t exit’?
Not sure I am saying this correctly: but if I disconnect web access [unplug the lan cable to my home network], the workbook opens/closes just fine [of course, the website doesn’t appear in the user form].


Do I need to link some event so that the webbrowser control ‘exits’ before excel closes?
OR
is there some event on the user form closing or excel closing that i can make the webbrowser control 'exit' first and prevent the hanging? [assuming this is the cause of the hanging issue]


If yes, do you know what ‘event’ that might be and/or which event is preferred? I’ve been checking the web, but can’t find quite how to accomplish that. [i'm sure i butchered this explanation, but i am not trained as a programmer, so i code by the bumper-car method when i have to code. sometimes that doesn't work - this is one of those times]


thanks,
ron :confused:
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

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