#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Navigation

New to automating some IE navigation within excel VBE, I've searched a
variety of forums already, and found little code example for navigating web
pages I just need a little boost.

The following code works great for opening a webpage automatically. IN this
example, it opens Mapquest. However, I have no idea how to set the code to
select variuos things on the web page and enter data, etc. Could someone
provide an example of how to enter some data into this webpage in the map
section and have it select the get map option? I can work off of that and
modify to suit my needs, I just need a tiny example of some web page
navigation, selecting things on a web page, etc, so I can see what the code
looks like. THANKS!!!!!

Dim IE As InternetExplorer
Set IE = New InternetExplorer

IE.Navigate URL:="http://www.mapquest.com/"
IE.Visible = True
Do While IE.Busy Or Not IE.ReadyState = _
READYSTATE_COMPLETE
DoEvents
Loop
MsgBox IE.Document.body.innerText
IE.Quit
Set IE = Nothing

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Navigation

Below is some example code. CCCC is the name of a input box on that page....

HTH,
Bernie
MS Excel MVP


Sub GETTAF()
Dim IE
Dim IPF

' Prepare to open the web page
Set IE = CreateObject("InternetExplorer.Application")

With IE
.Visible = True
.Navigate "http://weather.noaa.gov/weather/shorttaf.shtml"

' Loop until the page is fully loaded
Do Until Not .Busy
DoEvents
Loop

' Make the desired selections on the web page and click the submitButton
Set IPF = IE.Document.all.Item("CCCC")
IPF.Value = "LEVC"
Set IPF = IE.Document.all.Item("SUBMIT")
IPF.Value = "submit"
IPF.Click

' Loop until the page is fully loaded
Do Until Not .Busy
DoEvents
Loop

End With
Sheets("sheet1").Cells(1, "A").Value = IE.Document.body.innerText

' Close the internet explorer application
With IE
.Visible = True
End With

IE.Quit

End Sub


"bodhisatvaofboogie" wrote in message
...
New to automating some IE navigation within excel VBE, I've searched a
variety of forums already, and found little code example for navigating web
pages I just need a little boost.

The following code works great for opening a webpage automatically. IN this
example, it opens Mapquest. However, I have no idea how to set the code to
select variuos things on the web page and enter data, etc. Could someone
provide an example of how to enter some data into this webpage in the map
section and have it select the get map option? I can work off of that and
modify to suit my needs, I just need a tiny example of some web page
navigation, selecting things on a web page, etc, so I can see what the code
looks like. THANKS!!!!!

Dim IE As InternetExplorer
Set IE = New InternetExplorer

IE.Navigate URL:="http://www.mapquest.com/"
IE.Visible = True
Do While IE.Busy Or Not IE.ReadyState = _
READYSTATE_COMPLETE
DoEvents
Loop
MsgBox IE.Document.body.innerText
IE.Quit
Set IE = Nothing



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Navigation

That is pretty great, I appreciate that THANKS!!!


Now, how did you know that the input box was named CCCC? Is there something
hidden that I can look up to get ahold of that information for a web page?

Thanks!!!



"Bernie Deitrick" wrote:

Below is some example code. CCCC is the name of a input box on that page....

HTH,
Bernie
MS Excel MVP


Sub GETTAF()
Dim IE
Dim IPF

' Prepare to open the web page
Set IE = CreateObject("InternetExplorer.Application")

With IE
.Visible = True
.Navigate "http://weather.noaa.gov/weather/shorttaf.shtml"

' Loop until the page is fully loaded
Do Until Not .Busy
DoEvents
Loop

' Make the desired selections on the web page and click the submitButton
Set IPF = IE.Document.all.Item("CCCC")
IPF.Value = "LEVC"
Set IPF = IE.Document.all.Item("SUBMIT")
IPF.Value = "submit"
IPF.Click

' Loop until the page is fully loaded
Do Until Not .Busy
DoEvents
Loop

End With
Sheets("sheet1").Cells(1, "A").Value = IE.Document.body.innerText

' Close the internet explorer application
With IE
.Visible = True
End With

IE.Quit

End Sub


"bodhisatvaofboogie" wrote in message
...
New to automating some IE navigation within excel VBE, I've searched a
variety of forums already, and found little code example for navigating web
pages I just need a little boost.

The following code works great for opening a webpage automatically. IN this
example, it opens Mapquest. However, I have no idea how to set the code to
select variuos things on the web page and enter data, etc. Could someone
provide an example of how to enter some data into this webpage in the map
section and have it select the get map option? I can work off of that and
modify to suit my needs, I just need a tiny example of some web page
navigation, selecting things on a web page, etc, so I can see what the code
looks like. THANKS!!!!!

Dim IE As InternetExplorer
Set IE = New InternetExplorer

IE.Navigate URL:="http://www.mapquest.com/"
IE.Visible = True
Do While IE.Busy Or Not IE.ReadyState = _
READYSTATE_COMPLETE
DoEvents
Loop
MsgBox IE.Document.body.innerText
IE.Quit
Set IE = Nothing




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Navigation

Alright, I found the name of the box in the souce code. However, on some web
pages, it's not so distinct as to have that name = ** When looking at
the code for java script, how would one locate the name of a link to have the
macro click?

tabindex = \"0\"\r\n id = \"NB_IDENTIFY_CUSTOMER\"\r\n
onClick = \"if(!handleTransLaunch()){return false;}
go(this,\'IDENTIFY_CUSTOMER\',\'IDENTIFY_CUSTOMER\ ');return false;\"\r\n
<a href=\"#\" tabindex=\"-1\"Identify Account</a\r\n
</td\r\n\r\n </tr\r\n\r\n\r\n\r\n <tr\r\n <td class
= \"nb\"\r\n

This is an example of some of the info related to a link to have it click
this link, I assumed I'd go with the id, that didn't work....I tried to just
plug away into the macro using:

Set IPF = IE.Document.all.Item("NB_IDENTIFY_CUSTOMER")
IPF.Value = "NB_IDENTIFY_CUSTOMER"
IPF.Click

of course that failed, because I'm not familiar with all this web stuff.
Any advice would be GREAT!!! thanks!!!


"Bernie Deitrick" wrote:

Below is some example code. CCCC is the name of a input box on that page....

HTH,
Bernie
MS Excel MVP


Sub GETTAF()
Dim IE
Dim IPF

' Prepare to open the web page
Set IE = CreateObject("InternetExplorer.Application")

With IE
.Visible = True
.Navigate "http://weather.noaa.gov/weather/shorttaf.shtml"

' Loop until the page is fully loaded
Do Until Not .Busy
DoEvents
Loop

' Make the desired selections on the web page and click the submitButton
Set IPF = IE.Document.all.Item("CCCC")
IPF.Value = "LEVC"
Set IPF = IE.Document.all.Item("SUBMIT")
IPF.Value = "submit"
IPF.Click

' Loop until the page is fully loaded
Do Until Not .Busy
DoEvents
Loop

End With
Sheets("sheet1").Cells(1, "A").Value = IE.Document.body.innerText

' Close the internet explorer application
With IE
.Visible = True
End With

IE.Quit

End Sub


"bodhisatvaofboogie" wrote in message
...
New to automating some IE navigation within excel VBE, I've searched a
variety of forums already, and found little code example for navigating web
pages I just need a little boost.

The following code works great for opening a webpage automatically. IN this
example, it opens Mapquest. However, I have no idea how to set the code to
select variuos things on the web page and enter data, etc. Could someone
provide an example of how to enter some data into this webpage in the map
section and have it select the get map option? I can work off of that and
modify to suit my needs, I just need a tiny example of some web page
navigation, selecting things on a web page, etc, so I can see what the code
looks like. THANKS!!!!!

Dim IE As InternetExplorer
Set IE = New InternetExplorer

IE.Navigate URL:="http://www.mapquest.com/"
IE.Visible = True
Do While IE.Busy Or Not IE.ReadyState = _
READYSTATE_COMPLETE
DoEvents
Loop
MsgBox IE.Document.body.innerText
IE.Quit
Set IE = Nothing




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Navigation Ridhi Excel Worksheet Functions 1 June 3rd 08 06:00 PM
navigation Pam M Excel Discussion (Misc queries) 3 November 7th 07 09:47 PM
Navigation slavenp Excel Discussion (Misc queries) 3 August 15th 07 07:03 PM
Navigation dgragg Excel Worksheet Functions 1 April 5th 06 08:10 AM
Navigation help please Walt Campbell New Users to Excel 3 May 30th 05 08:52 PM


All times are GMT +1. The time now is 02:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"