ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   form field (https://www.excelbanter.com/excel-programming/414352-form-field.html)

geebee

form field
 
hi,

i was able to successfully use the following code in another website, but a
different website i am testing it on (the myDoc.forms(0).UserName.Value =
strSearch
is the error line being highlighted) yields an error:
"object doesn't support this property or method"

here is my code:

'Variable declarations
Dim myIE As New InternetExplorer 'New '
Dim myURL As String
Dim myDoc As HTMLDocument
Dim strSearch As String

'Set starting URL and search string
myURL = "https://site.login.com/GREATNESS/Logon.asp"
strSearch = "poweruser"

'Make IE navigate to the URL and make browser visible
myIE.navigate myURL
myIE.Visible = True

'Wait for the page to load
Do While myIE.Busy Or myIE.readyState < READYSTATE_COMPLETE
DoEvents
Loop

'Set IE document into object

Set myDoc = myIE.document

'Enter search string on form
myDoc.forms(0).UserName.Value = strSearch
myDoc.forms(0).Password.Value = "test"


how can i figure out whiat the fieldname is, or get closer to making this
work?

thanks in advance,
geebee





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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com