Bonjour,
Je débute sur VBA et j'ai un soucis avec ce message d'erreur 1024 / Ce pense que c'est lien à l'erreur 424:
Voici mon code :
Sub test()
Dim eRow As Long
Dim ele As Object
Set sht = Sheets("Feuil1")
RowCount = 1
sht.Range("A" & RowCount) = "Title"
sht.Range("B" & RowCount) = "Company"
sht.Range("C" & RowCount) = "Location"
sht.Range("D" & RowCount) = "Description"
eRow = Sheets.Cells(Rows.Count, 1).End(x1Up).Offset(1, 0).Row
Set objIE = CreateObject("InternetExplorer.Application")
myjobtype = InputBox("Type of Job")
myzip = InputBox("Enter Zipcode")
With objIE
.Visible = True
.Navigate "http://www.jobs.com/"
Do While .Busy Or _
.readyState <> 4
DoEvents
Loop
Set what = .document.getElementByName("q")
what.Item(0).Value = myjobtype
Set zipcode = .document.getElementByName("where")
zipcode.Item(0).Value = myzip
.document.getElementById("JobsButton").Click
Do While .Busy Or _
.readyState <> 4
DoEvents
Loop
For Each ele In .document.all
Select Case ele.classname
Case "Result"
RowCount = RowCount + 1
Case "Title"
aht.Range("A" & RowCount) = ele.innertext
Case "Company"
aht.Range("B" & RowCount) = ele.innertext
Case "Location"
aht.Range("C" & RowCount) = ele.innertext
Case "Description"
aht.Range("D" & RowCount) = ele.innertext
End Select
Next ele
End With
Macro1
Set objIE = Nothing
End Sub
Fichier ci-joint
Cdt,
Je débute sur VBA et j'ai un soucis avec ce message d'erreur 1024 / Ce pense que c'est lien à l'erreur 424:
Voici mon code :
Sub test()
Dim eRow As Long
Dim ele As Object
Set sht = Sheets("Feuil1")
RowCount = 1
sht.Range("A" & RowCount) = "Title"
sht.Range("B" & RowCount) = "Company"
sht.Range("C" & RowCount) = "Location"
sht.Range("D" & RowCount) = "Description"
eRow = Sheets.Cells(Rows.Count, 1).End(x1Up).Offset(1, 0).Row
Set objIE = CreateObject("InternetExplorer.Application")
myjobtype = InputBox("Type of Job")
myzip = InputBox("Enter Zipcode")
With objIE
.Visible = True
.Navigate "http://www.jobs.com/"
Do While .Busy Or _
.readyState <> 4
DoEvents
Loop
Set what = .document.getElementByName("q")
what.Item(0).Value = myjobtype
Set zipcode = .document.getElementByName("where")
zipcode.Item(0).Value = myzip
.document.getElementById("JobsButton").Click
Do While .Busy Or _
.readyState <> 4
DoEvents
Loop
For Each ele In .document.all
Select Case ele.classname
Case "Result"
RowCount = RowCount + 1
Case "Title"
aht.Range("A" & RowCount) = ele.innertext
Case "Company"
aht.Range("B" & RowCount) = ele.innertext
Case "Location"
aht.Range("C" & RowCount) = ele.innertext
Case "Description"
aht.Range("D" & RowCount) = ele.innertext
End Select
Next ele
End With
Macro1
Set objIE = Nothing
End Sub
Fichier ci-joint
Cdt,