access internet through VBA

  • Thread starter Thread starter thepowerofx
  • Start date Start date
T

thepowerofx

Hi All,

I'm writing a detailed program in excel vba compiling several
worksheets from various files into one. Some of these sheets are
generated by a private online server.

I would like help with writing code to access the internet and to
select the appropriate data to download by having vba automatically
select the appropriate CHECKBOXES on the website.

~newbie
 
Hi All,

I'm writing a detailed program in excel vba compiling several
worksheets from various files into one. Some of these sheets are
generated by a private online server.

I would like help with writing code to access the internet and to
select the appropriate data to download by having vba automatically
select the appropriate CHECKBOXES on the website.

~newbie

Start by searching something like "IE Automation" within the group.
There's lots of internet automation stuff within the group. I have
found code on clicking items from drop downs, clicking on images and
links, selecting check boxes, etc.

Matt
 
I would like help with writing code to access the internet and to
select the appropriate data to download by having vba automatically
select the appropriate CHECKBOXES on the website.

I probably did it the very hard way (one of my trademarks!), but I
managed something similar in Word VBA. I used objects Dim'd without a
type to get to the IE Application object, the IE Document object,
iterate through all the input and link objects until I found the name
of the one I wanted set an object to it, and then finally wound up
with objCB.onclick to actuate the on-click event of the checkbox and
run the associated script.

I got a lot of help from the following web sites:
http://slayeroffice.com/tools/modi/v2.0/modi_help.html
A Java Bookmarklet that runs an on-screen object identifier
http://www.w3schools.com/htmldom/dom_intro.asp
A breakdown of the IE document and application objects
http://msdn2.microsoft.com/en-us/library/ms531073.aspx#
Another look at the IE document object

Have fun!
Ed
 
Hi,
this link is essential

http://msdn2.microsoft.com/en-us/library/Aa752084.aspx

and a piece of code....

Public wIE As InternetExplorer

Public Sub XXX()
Dim hDocIE As HTMLDocument

Set wIE = New InternetExplorer
If QVER Then
wIE.Visible = True
Else
wIE.Silent = True
''''' BUG MICROSOFT SENÃO NÃO Hà EVENTOS
wIE.Left = -1 * (wIE.Width)
End If
wIE.navigate "www.XPTO.com"
.......
Do
Set hDocIE = Nothing
Set hDocIE = wIE.document
Sleep 100
SC = hDocIE.all.Length - 1
If hDocIE.all.Item(SC).readyState = "complete" Then Exit Do
If NN > 12 Then
TUNGA = True
Exit Do
End If
Sleep 1000
NN = NN + 1
Loop
If TUNGA Then Err.Raise 45600, , "Error...."


HTH
João Rodrigues
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top