Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Importing web data to a VBA Array

Hi Claymore,

You can do things like this with the XMLHTTP object (search on Google /
Google Groups for more info). Basically, you would open the URL with the
GET method and invoke the Send method, and the resulting HTML source for
that page can be retrieved using the ResponseText property.

Once you have the HTML source for the page, you'll have to get creative with
parsing it out and storing values to an array. Looking at the yahoo!
finance page you referenced, it may be difficult, as not many of the
elements are named or have unique strings in them.

After looking up references for the XMLHTTP object, let us know if you have
any more questions or need more guidance.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Claymore wrote:
Hello,

The below code imports a small table from yahoo finance to range A1
of the current sheet.

ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://finance.yahoo.com/q/hp?s=DELL",
Destination:=Range("A1")

What I want to do is import the same table to an array in VBA memory
and then access the array to spit out a specific part of the table.
So instead of pasting the table to a sheet and then cutting and
pasting the number I need, I can just paste the number I need. The
problem is I cant figure out how to import the data to anything other
than a physical range.

Any Help would be greatly Appreciated.

Thanks Much


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing:Data Connection Wizard Doesn't see Source Data - No Impo Exotic Hadron Excel Discussion (Misc queries) 0 October 1st 08 07:35 PM
Removing Data Tables formed from importing data from Access Andrea Jones Excel Discussion (Misc queries) 0 April 10th 08 12:01 PM
Importing Data: OLE DB and data link properties dialog Vivek Excel Discussion (Misc queries) 0 October 22nd 07 03:59 PM
Data types when importing Excel data to SQLServer [email protected] Excel Discussion (Misc queries) 1 September 27th 06 12:48 PM
Importing data, then adding data to the new spreadsheet.. a conund AndyL82 Excel Discussion (Misc queries) 1 March 9th 06 10:05 PM


All times are GMT +1. The time now is 01:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"