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.
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.