Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Download Website to Excel Sheet

Reply
 
Old 05-01-2009   #1 (permalink)
kosser


 
 

Download Website to Excel Sheet

If I have opened Website, how download info to Excel Sheet with Vba?



My System SpecsSystem Spec
Old 05-01-2009   #2 (permalink)
mr_unreliable


 
 

Re: Download Website to Excel Sheet

kosser wrote:
Quote:

> If I have opened Website, how download info to Excel Sheet with Vba?
>
hi Kosser,

There are (at least ) two answers to this:

1: If you just want to download the page, then you can use
ms' "Microsoft.XMLHTTP" object to download the page to a
string array. Then you can sift through the page (text)
to get what you want. There are numerous examples of how
to do this in the archives of this ng.

2: If you just want to pick up some specific data off the
page (for example, to get a stock quote) then you could use
msXL's built-in "web query" feature. This is probably discussed
in your XL help file, and if not then you can read about it
on msdn:

http://office.microsoft.com/en-us/ex...548481033.aspx


cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but, no guarantee
the answers will be applicable to the questions)
My System SpecsSystem Spec
Old 05-01-2009   #3 (permalink)
kosser


 
 

Re: Download Website to Excel Sheet


"mr_unreliable" <kindlyReplyToNewsgroup@xxxxxx> wrote in message
news:ODRAFWpyJHA.1492@xxxxxx
Quote:

> kosser wrote:
Quote:

>> If I have opened Website, how download info to Excel Sheet with Vba?
>
> hi Kosser,
>
> There are (at least ) two answers to this:
>
> 1: If you just want to download the page, then you can use
> ms' "Microsoft.XMLHTTP" object to download the page to a
> string array. Then you can sift through the page (text)
> to get what you want. There are numerous examples of how
> to do this in the archives of this ng.
>
> 2: If you just want to pick up some specific data off the
> page (for example, to get a stock quote) then you could use
> msXL's built-in "web query" feature. This is probably discussed
> in your XL help file, and if not then you can read about it
> on msdn:
>
> http://office.microsoft.com/en-us/ex...548481033.aspx
>
>
> cheers, jw
> ____________________________________________________________
>
> You got questions? WE GOT ANSWERS!!! ..(but, no guarantee
> the answers will be applicable to the questions)

Thanks jw for responding.
Earlier I was downloading with web query , but website owner put "captha
test" in website and this problem is insolvable .
Your variant1 (Microsoft.XMLHTTP) is what I am interesting.
But i very noobie for VBA (my english too very bad) and need help.
I was meet diferent code where used manipulations with URL, but i dont need
this way.

Need simple way: opened website load all info- copy all text to excel sheet.
(Not hyperlinks, not controlls, not pictures, not txt fail).


Private Sub CommandButton1_Click()

'Reference needed for Microsoft Internet Controls

Dim SWs As SHDocVw.ShellWindows

Dim i As Long, Adres As String

Set SWs = New SHDocVw.ShellWindows



For i = SWs.Count - 1 To 0 Step -1

Adres = CStr(SWs(i).LocationURL)

If Adres Like "http*" Then



' Something like this:

' ActiveWebsite.Select.All

' ActiveWebsite.Copy

' Wbk("Data.xls").Activate

' Wbk("Data.xls").Sheet1.Open

' Selection.Paste



End If

Next i

Range("A1").Select

Set SWs = Nothing

End Sub


Or some sample code using: Microsoft.XMLHTTP


































My System SpecsSystem Spec
Old 05-01-2009   #4 (permalink)
Tim Williams


 
 

Re: Download Website to Excel Sheet

If the site uses a method like CAPTCHA then xmlhttp isn't going to help you.

Tim

"kosser" <kosser@xxxxxx> wrote in message
news:uUpwVZqyJHA.5684@xxxxxx
Quote:

>
> "mr_unreliable" <kindlyReplyToNewsgroup@xxxxxx> wrote in message
> news:ODRAFWpyJHA.1492@xxxxxx
Quote:

>> kosser wrote:
Quote:

>>> If I have opened Website, how download info to Excel Sheet with Vba?
>>
>> hi Kosser,
>>
>> There are (at least ) two answers to this:
>>
>> 1: If you just want to download the page, then you can use
>> ms' "Microsoft.XMLHTTP" object to download the page to a
>> string array. Then you can sift through the page (text)
>> to get what you want. There are numerous examples of how
>> to do this in the archives of this ng.
>>
>> 2: If you just want to pick up some specific data off the
>> page (for example, to get a stock quote) then you could use
>> msXL's built-in "web query" feature. This is probably discussed
>> in your XL help file, and if not then you can read about it
>> on msdn:
>>
>> http://office.microsoft.com/en-us/ex...548481033.aspx
>>
>>
>> cheers, jw
>> ____________________________________________________________
>>
>> You got questions? WE GOT ANSWERS!!! ..(but, no guarantee
>> the answers will be applicable to the questions)
>
>
> Thanks jw for responding.
> Earlier I was downloading with web query , but website owner put "captha
> test" in website and this problem is insolvable .
> Your variant1 (Microsoft.XMLHTTP) is what I am interesting.
> But i very noobie for VBA (my english too very bad) and need help.
> I was meet diferent code where used manipulations with URL, but i dont
> need this way.
>
> Need simple way: opened website load all info- copy all text to excel
> sheet. (Not hyperlinks, not controlls, not pictures, not txt fail).
>
>
> Private Sub CommandButton1_Click()
>
> 'Reference needed for Microsoft Internet Controls
>
> Dim SWs As SHDocVw.ShellWindows
>
> Dim i As Long, Adres As String
>
> Set SWs = New SHDocVw.ShellWindows
>
>
>
> For i = SWs.Count - 1 To 0 Step -1
>
> Adres = CStr(SWs(i).LocationURL)
>
> If Adres Like "http*" Then
>
>
>
> ' Something like this:
>
> ' ActiveWebsite.Select.All
>
> ' ActiveWebsite.Copy
>
> ' Wbk("Data.xls").Activate
>
> ' Wbk("Data.xls").Sheet1.Open
>
> ' Selection.Paste
>
>
>
> End If
>
> Next i
>
> Range("A1").Select
>
> Set SWs = Nothing
>
> End Sub
>
>
> Or some sample code using: Microsoft.XMLHTTP
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Search through Excel sheet and Fill in data. PowerShell
Re: Color to Excel sheet? #FF0000 (255,0,0) VB Script
Find the last Row in an Excel Spread Sheet PowerShell
how to write recordset datas of vbscript into existing excel sheet VB Script
create pdf file from each excel sheet. PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46