Skip to content

Instantly share code, notes, and snippets.

@onodes
Created November 3, 2010 18:37
Show Gist options
  • Save onodes/661488 to your computer and use it in GitHub Desktop.
Save onodes/661488 to your computer and use it in GitHub Desktop.
IDManagerForExcelVBA
Private Sub CommandButton1_Click()
Dim ie As Object
Dim data(20) As String
Dim i As Integer
For i = 1 To 20
data(i) = Cells(i, 1)
Next i
Set ie = CreateObject("InternetExplorer.Application")
ie.Navigate Cells(1, 3).Value
ie.Visible = True
waitIE ie
i = 1
For Each f In ie.Document.all.tags("input")
' TEXTBOX
If LCase(f.Type) = "text" Then
Debug.Print f.Name
f.Value = data(i)
i = i + 1
End If
Next f
End Sub
Sub waitIE(ie)
' http://www.excel.studio-kazu.jp/kw/20070219032632.html
' http://www.ken3.org/cgi-bin/group/vba_ie.asp#Document_ReadyState_Busy
Do While ie.Busy = True Or ie.readystate <> 4
DoEvents
Loop
Sleep 100
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment