PDA

View Full Version : vba help



namrata
11-15-2010, 02:39 AM
i want to print the name of my web page and product price in my excel how do i do it please help
i tried creating this code which is not working

UserForm1.WebBrowser1.Silent = True
Dim Strhtml As String
Dim cntr, a As Integer
cntr = 0
i = 2
While Sheet3.Cells(i, 1) <> ""
UserForm1.WebBrowser1.navigate Sheet3.Cells(i, 1)
delay 5
While UserForm1.WebBrowser1.readyState = READYSTATE_LOADING
delay 4
Wend

Strhtml = UserForm1.WebBrowser1.document.DocumentElement.innerHTML

bunch = GetText2(Strhtml, "Game Details", "")
Sheet3.Cells(i, 2) = GetText2(bunch, "=details_block>", "
")

i = i + 1
Wend

Frenchy646
11-15-2010, 03:29 AM
As I have no experience in automating excel with a web page, I can't help as such.

however, in future, I would advise using a VBA tag to put code on the forum, as it makes it easier to read. I myself have forgot to put code in VBA tags, and was advised what I am now advising you :)
UserForm1.WebBrowser1.Silent = True
Dim Strhtml As String
Dim cntr, a As Integer
cntr = 0
i = 2
While Sheet3.Cells(i, 1) <> ""
UserForm1.WebBrowser1.navigate Sheet3.Cells(i, 1)
delay 5
While UserForm1.WebBrowser1.readyState = READYSTATE_LOADING
delay 4
Wend

Strhtml = UserForm1.WebBrowser1.document.DocumentElement.innerHTML

bunch = GetText2(Strhtml, "Game Details", "")
Sheet3.Cells(i, 2) = GetText2(bunch, "=details_block>", "
")

i = i + 1
Wend