On 14 Jun, 16:54, joeu2004 <joeu2...@hotmail.com> wrote:
> On Jun 14, 8:14 am, LDB <l.br...@gmail.com> wrote:
>
> > On 14 Jun, 15:53, joeu2004 <joeu2...@hotmail.com> wrote:
> > > When I get stuck, I turn on macro record mode and try a similar
> > > operation -- in this case, web query. Here is what I got:
>
> > > With ActiveSheet.QueryTables.Add(Connection:= _
> > > "URL;http://bigcharts.marketwatch.com/historical",
> > > Destination:=Range("A1"))
> > [....]
> > Since posting I realised I can specify a 'URL' connection - this
> > works, however I cannot delimit by comma when I import! I don't really
> > want the whole line dumping in one cell.
> > Any other idea?
>
> I am a relative "newbie" when it comes to network programming using
> VBA. I'm afraid I don't know much about it.
>
> But I can tell that you when I use Web Query on a table from a web
> page, the data goes into separate cells.
>
> So again, I would suggest that you do a Web Query with macro recording
> mode enabled, then experiment with the many "extraneous" lines of VBA
> code to see which ones, if any, are needed to distribute the data
> among cells.
>
> Then again, perhaps the problem is with the design of the web page,
> not so much the VBA programming. I'm afraid I know nothing about HTML
> programming either.
>
> (Sigh, I'm a programming dinosaur. Ask me anything about Fortran ;-
>
> >. Actually, I've forgotten all that, too. But C .... ;->.)
>
> I know there a lot of knowledgable VBA programmers in these forums who
> can help. Hopefully they will chime in and give you dispositive
> answers.
Joe,
Thanks for your help so far.
Unfortunately, I can't (or don't want to) edit the source of the data
to be imported - they are CSV files created by a monthly cron job
which are being hosted by Apache.
I'm currently doing the VBA-translation of a 'Web Query' (i.e.
Connection:="URL;...") but that only wants to dump my data into one
column, I can't distribute it along the cells horizontally - maybe I
need to go through and seperate by comma afterwards? Although that
sounds like an annoying way considering the number of lines my CSV
could span varies...
Louis
|