Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
filout web page form
Hello
Is there a way to use a spreadsheet to automatically add data to a form on a web page? tia Basil |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
filout web page form
Basil,
Yes, if the form fields are named. See example code below. 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").Select ActiveSheet.Cells(1, "A").Value = IE.Document.body.innerText ' Close the internet explorer application With IE .Visible = True End With IE.Quit Dim myStr As String myStr = IE.Document.body.innerText myStr = Mid(myStr, InStr(1, myStr, "TAF"), Len(myStr)) myStr = Left(myStr, InStr(InStr(1, myStr, Chr(13)) + 1, myStr, Chr(13))) ActiveSheet.Cells(1, "A").Value = myStr ' Call PASTETAF End Sub "basil" wrote in message ... Hello Is there a way to use a spreadsheet to automatically add data to a form on a web page? tia Basil |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
filout web page form
Thanks Bernie
I'll give this a try "Bernie Deitrick" <deitbe @ consumer dot org wrote in message ... Basil, Yes, if the form fields are named. See example code below. 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").Select ActiveSheet.Cells(1, "A").Value = IE.Document.body.innerText ' Close the internet explorer application With IE .Visible = True End With IE.Quit Dim myStr As String myStr = IE.Document.body.innerText myStr = Mid(myStr, InStr(1, myStr, "TAF"), Len(myStr)) myStr = Left(myStr, InStr(InStr(1, myStr, Chr(13)) + 1, myStr, Chr(13))) ActiveSheet.Cells(1, "A").Value = myStr ' Call PASTETAF End Sub "basil" wrote in message ... Hello Is there a way to use a spreadsheet to automatically add data to a form on a web page? tia Basil |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Select page tab when form opens | Excel Programming | |||
New form number for each page printed | Excel Discussion (Misc queries) | |||
Turning .xls form into web page | Excel Discussion (Misc queries) | |||
VBA - Loading a certain page when firing up a form | Excel Programming | |||
how to put a reference from a page of a multipage form to another page | Excel Programming |