Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello.
My code can fill out some fields on websites. But it works only on simple websites. Most websites have frame- or metaelements and i don't know how to fill out those websites. Any hint's? Greetings from Germany, Andreas. Option Explicit Sub Fill_IE() Dim I As Integer Dim SW As New ShellWindows Dim IE As InternetExplorer Dim Item As Object 'Open an IE and go to a URL Set IE = CreateObject("InternetExplorer.Application") IE.Visible = True IE.Navigate "http://www.marktkauf.de/SiteAssistant.php/15-0-kw40_games" 'Access all explorer windows For I = 0 To SW.Count - 1 Set IE = SW.Item(I) Debug.Print Debug.Print IE.LocationName Debug.Print IE.LocationURL 'An "normal"-explorer starts with "file", skip that windows If Left(IE.LocationURL, 4) = "http" Then 'Go through all elements For Each Item In IE.Document.all 'select only elements that can have input fields Select Case TypeName(Item) Case "HTMLSelectElement": If Item.Type = "radio" Then 'I don't know End If Case "HTMLInputElement": If Item.Type = "text" Then Select Case Item.Name Case "forename": Item.Value = "Andreas" Case "name": Item.Value = "Killer" Case "email": Item.Value = " Case Else Debug.Print TypeName(Item) & " - " & Item.Name End Select End If Case Else: Debug.Print TypeName(Item) End Select Next End If Next End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatically fill cell value | Excel Worksheet Functions | |||
Fill Chart Automatically | Charts and Charting in Excel | |||
dates - automatically fill next day | New Users to Excel | |||
How to automatically fill a column? | New Users to Excel | |||
automatically fill up a cell? | Excel Programming |