Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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
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
Select page tab when form opens [email protected] Excel Programming 4 December 6th 06 06:10 PM
New form number for each page printed jimqual7 Excel Discussion (Misc queries) 6 March 20th 06 04:24 PM
Turning .xls form into web page EdLeeYoung Excel Discussion (Misc queries) 1 May 18th 05 03:56 AM
VBA - Loading a certain page when firing up a form khot78 Excel Programming 2 August 10th 04 05:42 PM
how to put a reference from a page of a multipage form to another page Valeria[_2_] Excel Programming 2 January 25th 04 08:21 AM


All times are GMT +1. The time now is 04:51 PM.

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"