PDA

Click to See Complete Forum and Search --> : How to get around missing Internet Exploerer control


garybenjamin
Feb 11th, 2001, 01:30 PM
I have made a custom form for an Excel project. On the form is an animated GIF. To display the gif, I am using the Internet Explorer control. However, it is possible that some users of the form may not have I.E. available. To accommodate that, I have a non-animated gif in an image control. I also have written a program that determines if I.E. is installed or not (by looking in the registry for the location of the I.E. file.)

My question: How do I use the information that I.E. is not available to open the form without an error? I have thought of four strategies, from easiest to implement to the hardest:

1. Have both the I.E. the image controls on the form. If I.E. is not available, hide the I.E. control during initialization. (Will a hidden control that is not installed cause an error when the form is shown?)

2. Have both the I.E. the image controls on the form. If I.E. is not available, delete the I.E. control during initialization. (Will a non-installed control cause an error when the form is loaded?)

3. Have only the image control on the form. If I.E. is available, add the I.E. control to the form during initialization. (Will the mere mention of a non-installed control in the VB code cause an error? Is it necessary to put the add in a subroutine of its own, which only gets executed if the control exists?)

4. Have two copies of the form, one with each kind of control. Open the appropriate form depending on whether I.E. is available or not. (Will the existance of an uninstalled control cause an error, even if the form is not loaded?)

My problem is, I do not know which of the above will work without error. I can't test, because I.E. is installed on my system, and I do not have another system without I.E. to test on. My root problem is that I do not know what is legal when a control is missing. I also do not know how to simulate a missing control, so I can figure it out by trial and error. Would it be sufficient to just temporarily rename the I.E. file (which one), or is it necessary to delete certain registry entries to get a proper simulation. Perhaps there is another control that I can add to my form that I can easily uninstall after it has been added.

Clunietp
Feb 11th, 2001, 11:06 PM
Hey Gary, that all sounds like a pain in the butt

With VB you can dynamically create controls at run time, but I don't know offhand if that only applies to intrinsic controls

Why don't you just have an array of picture/image controls and simulate the animated gif? This would be much easier and require no external dependencies

garybenjamin
Feb 12th, 2001, 11:51 AM
Thanks, Clunietp, for the suggestion.

I originally was going to do that. I was going to use the clip control and a timer to cycle through the images. The trouble was, this form is in Excel, and there is no timer control in Excel. I was also trying to avoid requiring the user to have to install anything to make the workbook work (although I realize now that an install package is practically unavoidable, so if I could somehow get the timer control from VB6 to work in Excel, I might consider implementing that.)