Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to have an array of browsers in VB (Dim WithEvents o_IE As InternetExplorer / Set o_IE = New InternetExplorer)

Posted on 2009-07-05
7
Medium Priority
?
435 Views
Last Modified: 2013-12-26
Hello !

I have a project controlling IE. So far it works fine.
Now I want to add a second instance (or even several).

I was wondering if I can put them all into an array (and how).

Thank you for any idea !

Susan
Dim test(3) As String; <- works
 
Dim WithEvents o_IE As InternetExplorer;<- works too
 
Dim WithEvents o_IEarray(3) As InternetExplorer ,<- does not (syntax error, expecting AS)

Open in new window

0
Comment
Question by:DistributedServices
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 19

Expert Comment

by:elimesika
ID: 24779326
Should be:
Dim o_IEarray(3) As InternetExplorer

Open in new window

0
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 24779472
If you have an array of InternetExplorer's, don't use WithEvents, but add your event handlers with AddHandler.

Also, I would use a generic list, of type InternetExplorer....

        Dim IEList As New List(Of InternetExplorer)
        Dim IE As InternetExplorer '= however you get the IE object
        AddHandler IE.DocumentComplete, AddressOf IE_DocumentComplete
        IEList.Add(IE)

...where IE_DocumentComplete is the routine to handle the DocumentComplete event of the IE object.

Wayne
0
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 24779486
sorry, just realised your are using VB6. Ignore my comment above.
0
Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

 

Author Comment

by:DistributedServices
ID: 24782864
Hi elimesika !

Of cause that work's but how do I get the events?
0
 
LVL 19

Accepted Solution

by:
elimesika earned 1500 total points
ID: 24783005
0
 

Author Comment

by:DistributedServices
ID: 24791924
Thank you, elimesika, for your help about raising events in VB6.

On http://www.codeguru.com/columns/vb/article.php/c6557 I did not find, how to receive an event (normally a function is been called when an event raises).  

Do you have any idea how to dim an array of browsers with events, like

Dim WithEvents o_IEarray(3) As InternetExplorer

???
0
 
LVL 19

Expert Comment

by:elimesika
ID: 24803230
Sorry for the delay (have lot of work to do), will look at it ASAP...
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question