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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,216,082
Messages
6,128,713
Members
449,464
Latest member
againofsoul

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