?
Solved

ie Object in VBA

Posted on 2009-02-15
5
Medium Priority
?
950 Views
Last Modified: 2013-11-25
Hi to everybody,
in VBA I nedd to extract from this page

http://www.professionisti.bticino.it/web/catalog/online/articledetails.do?articleId=IT_BTI_ARTC1000000761

the URL of the image and the item's description.

I've fumbled with ie Object but I couldn't extract the html I need. Below are the few lines I've put together; I couldn't find a complete documentation about the properties of HTMLDocument.
Thanks for any help
Dim ie As Object
 
Set ie = CreateObject("InternetExplorer.Application") 'Need a reference to Microsoft Internet Controls
 
With ie
.MenuBar = 1
.Toolbar = 1
.StatusBar = 1
.Navigate "http://www.professionisti.bticino.it/web/catalog/online/articledetails.do?articleId=IT_BTI_ARTC1000000761"
.Visible = 1
End With
 
'wait a while until IE as finished to load
Do While ie.busy
DoEvents
Loop
 
Dim HTMLDoc As HTMLDocument   'Need a reference to Microsoft HTML Object Library
Set HTMLDoc = ie.Document
Dim Elm As IHTMLElement 'Object
For Each Elm In HTMLDoc.all
   Debug.Print Elm.tagName 
' *** And NOW?? ***
Next

Open in new window

0
Comment
Question by:VBAstuff
1 Comment
 
LVL 28

Accepted Solution

by:
sybe earned 2000 total points
ID: 23669575
Don't use the IE object, use XMLHTTP
Function ReadUrl(ByVal sUrl)
    Dim oXMLHttpRequest
    Set oXMLHttpRequest = CreateObject("Microsoft.XMLHTTP")
    oXMLHttpRequest.open "GET", sUrl, False
    oXMLHttpRequest.send
    ReadUrl = oXMLHttpRequest.responseText
    Set oXMLHttpRequest = Nothing
End Function

Open in new window

0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Introduction to Processes
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question