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


Connecting to Popup Web Page using VBA

Posted on 2010-11-13
Medium Priority
Last Modified: 2012-05-10
Hello Experts, we are trying to automate connecting to a website, logging in and performing certain  tasks using VBA. All is working well till we get to a particular submit button that when clicked on manually brings up a popup webpage.
The code below shows the IE source code and snippets of what we are doing in VBA. Any assistance here would be greatly appreciated.
'Here is what part of the IE source code of the submit button looks like:
<input type="submit" name="_ctl7:_ctl4:btnMemberLookup" value="Select Players For Ballot" onclick="return btnMemberLookup_onclick();if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " language="javascript" id="_ctl7__ctl4_btnMemberLookup" style="width:170px;" />

'Here is how we are connecting to the URL:
strURL = "the location of the webpage we are trying to automate"
' Create an object of type InternetExplorer
    Set objIE = CreateObject("InternetExplorer.Application")

    ' Use the Navigate method to make our IE object visit a web page (strURL=Your web page)
    objIE.navigate strURL

    ' Make the InternetExplorer window visible    objIE.Visible = True

'We are not having any problems doing other things on the form such as clicking on the following button:
'Click on View/Add Ballot
    While objIE.ReadyState <> 4 Or objIE.Busy = True
'However when we try to use VBA o the Member Lookup button it fails. We tried .submit and it doesn't work either.
    While objIE.ReadyState <> 4 Or objIE.Busy = True

Open in new window

Question by:DonGarry
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
  • 4
  • 3

Author Comment

ID: 34151556
Hello boag2000:

Thanks for you reply....
I've looked at your links and still cannot find a solutions.

Here is what I have tried and still no luck:

I'm getting the error: object doesn't support this property or method (438)

Any other suggestions?
LVL 74

Accepted Solution

Jeffrey Coachman earned 1500 total points
ID: 34151616
That error, most likely, has to do with code syntax.

You get this error on all of the examples you posted?
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 34151670
Yes I do as a matter of fact...and I've looked at the syntax 100 times at least and am not spotting anything obvious....hmmmm
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34152412
Remember that some of those links presume that you are using a webbrowser control...
Are you?

Author Closing Comment

ID: 34161058
Well as it turns out you were right! It was a syntax problem...I guess I'm going blind.

The correct syntax to open up the popup window is indeed:
(I was missing an underscore)

Thanks for the help!
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34161541

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

722 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