|
-
Oct 17th, 2006, 07:54 AM
#1
Thread Starter
New Member
[RESOLVED] VBA downloading source from internet
Hi everyone
I have a problem. I am creating a modual in vba to get source code from the internet. The file is a xml file.
I wanted to use Microsoft Internet Transfer Control 6.0 but vba won’t let me use it because it isn’t correctly licensed even though i have registered it with regsur32.
I was wondering if there was another way. So any suggestions would be appreciated
-
Oct 17th, 2006, 07:57 AM
#2
Frenzied Member
Re: VBA downloading source from internet
I think that control is only available in VB6, not through VBA.
Beantown Boy
Please use [highlight=vb]your code goes in here[/highlight] tags when posting code.
When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
-
Oct 17th, 2006, 08:06 AM
#3
Thread Starter
New Member
Re: VBA downloading source from internet
Do you know another way to download source off the internet?
-
Oct 17th, 2006, 08:19 AM
#4
Re: VBA downloading source from internet
 Originally Posted by daywalker
Do you know another way to download source off the internet?
Not using VBA, but, the VBA people probably do. 
Moved to Office Development
-
Oct 17th, 2006, 10:03 AM
#5
Thread Starter
New Member
Re: VBA downloading source from internet
Does anyone know how to get a xml of a website using vba
-
Oct 17th, 2006, 03:18 PM
#6
Fanatic Member
Re: VBA downloading source from internet
I've used HTTPRequest w/ VBA (need reference to Microsoft XML or Microsoft Internet Controls I don't remember which) to download source:
VB Code:
Private Function GetWebPage(ByRef URL As String) As String
Dim xml As IXMLHTTPRequest
On Error Resume Next
Set xml = CreateObject("Microsoft.XMLHTTP")
With xml
.Open "GET", URL, False
.send
GetWebPage = .responseText
End With
Set xml = Nothing
End Function
Also used the following Win API function w/ VBA to download source to a text file:
http://www.allapi.net/apilist/URLDownloadToFile.shtml
Last edited by VBAhack; Oct 17th, 2006 at 03:21 PM.
-
Oct 18th, 2006, 06:13 AM
#7
Thread Starter
New Member
Re: VBA downloading source from internet
Thanks VBAhack for pointing me in the right dirrection.
This is how I finally did it
(needs reference to Microsoft XML v4.0)
VB Code:
Sub getXML(xmlPath As String)
Dim HttpReq As New MSXML2.XMLHTTP40
HttpReq.Open "GET", xmlPath, False
HttpReq.Send
MsgBox HttpReq.ResponseText
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|