megatronixs
Registered User.
- Local time
- Today, 07:53
- Joined
- Aug 17, 2012
- Messages
- 719
Hi all,
I made in excel a automation to do google searches for a range in a sheet.
the code goes row by row and uses the names in the range to insert them into google.
I would like to do the same in access, but I can't find any info on it.
I created a sample database where I inserted a subform in the main form. The subform has several records in it and is shown as a datasheet.
let's say I wanted to search for:
Pino
John
Samuel
For each name I need to search the first page and second one, and this is done for news search as well, page one and 2.
Here is the code I used in excel:
I also attach the sample database
Any help to get this moving would be really nice.
Greetings
I made in excel a automation to do google searches for a range in a sheet.
the code goes row by row and uses the names in the range to insert them into google.
I would like to do the same in access, but I can't find any info on it.
I created a sample database where I inserted a subform in the main form. The subform has several records in it and is shown as a datasheet.
let's say I wanted to search for:
Pino
John
Samuel
For each name I need to search the first page and second one, and this is done for news search as well, page one and 2.
Here is the code I used in excel:
Code:
Private Sub btn_google_searches_Click()
Dim ie As Object
'Dim rng As Range
'Dim LastRow As Long
'Dim rCell As Range
'Dim rRng As Range
'ExecWB 6, 2
Set ie = CreateObject("InternetExplorer.Application")
'With ActiveSheet
'LastRow = Cells(.Rows.Count, "B").End(xlUp).Row
'Set rRng = Range("B3:B" & LastRow)
ie.Visible = True
'With ActiveSheet
'For Each rCell In rRng.Cells
'Debug.Print rCell.Address, rCell.Value
ie.Navigate "http://www.google.com" & "/" & "search?q=" & rCell & "&start=0"
Do While ie.Busy: DoEvents: Loop
Do While ie.ReadyState <> 4: DoEvents: Loop
' ie.ExecWB 6, 2
' MsgBox "You go now to the second page web search"
' ie.Navigate "http://www.google.com" & "/" & "search?q=" & rCell & "&start=10"
' Do While ie.Busy: DoEvents: Loop
' Do While ie.ReadyState <> 4: DoEvents: Loop
' ie.ExecWB 6, 2
'
' MsgBox "You go now to the first page news search"
'
' ie.Navigate "http://www.google.com" & "/" & "search?q=" & rCell & "&tbm=nws&start=0"
'
' Do While ie.Busy: DoEvents: Loop
' Do While ie.ReadyState <> 4: DoEvents: Loop
' ie.ExecWB 6, 2
' MsgBox "You go now to the second page news search"
' ie.Navigate "http://www.google.com" & "/" & "search?q=" & rCell & "&tbm=nws&start=10"
'
' Do While ie.Busy: DoEvents: Loop
' Do While ie.ReadyState <> 4: DoEvents: Loop
' ie.ExecWB 6, 2
'
' MsgBox "You go now to the next search"
' Next rCell
'End With
'End With
MsgBox "This is the end of your Google searches mi amigo!"
End Sub
I also attach the sample database
Any help to get this moving would be really nice.
Greetings