Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default 2 Qs: grab net page, and import as fixed length format


I have a series of... oh, about 96-100 web pages that I need to download
into separate Excel worksheets. The source files are raw text. The web
address is just the name of the file (no htm or asp or other extension,
just "www..../cmhoct02" and when I copy and paste the entire page into
notepad, it looks exactly the same as onscreen. Characters are fixed width,
and each new column starts after a specific number of chars. I verified by
also looking at the source of the page, and there are no html tags, just
the raw text exactly like it looks in the browser.

I've done some other stuff with VBA, but never anything to do with
accessing or downloading web pages, so I need some pointers for where to
start (code snippets, general info, etc). I can write the code to generate
the string of the full web address including the filename (fortunately they
are sequential), but how do I use that to have Excel access the page and
grab the contents?

Also, when I copy/paste the web page into Excel as-is, it puts the whole
darn thing into one cell (one row anyway, and it seems to automatically
merge multiple columns).

When importing each page, I want to pull the "visual" data columns into
separate columns in each XL worksheet. I know if I was importing a flat
file, the import wizard would allow me to do this; can I access the same
functionality directly, or do I need to parse each line as it comes in and
force it into separate columns myself?

Using XL97

Many TIA,
Keith R


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default grab net page, and import as fixed length format

Try just opening the URL

workbooks.Open Filename:=http://www.someserver.com/somefile

If it puts all the data in one column, just select the data and do
Data=Text to column. This will take you through the text import wizard
after the fact so to speak.

turn on the macro recorder before doing it to get the code.

--
Regards,
Tom Ogilvy


"Keith R" wrote in message
news:01c3c0b9$eaf95f40$476a1bac@PC12001...

I have a series of... oh, about 96-100 web pages that I need to download
into separate Excel worksheets. The source files are raw text. The web
address is just the name of the file (no htm or asp or other extension,
just "www..../cmhoct02" and when I copy and paste the entire page into
notepad, it looks exactly the same as onscreen. Characters are fixed

width,
and each new column starts after a specific number of chars. I verified by
also looking at the source of the page, and there are no html tags, just
the raw text exactly like it looks in the browser.

I've done some other stuff with VBA, but never anything to do with
accessing or downloading web pages, so I need some pointers for where to
start (code snippets, general info, etc). I can write the code to generate
the string of the full web address including the filename (fortunately

they
are sequential), but how do I use that to have Excel access the page and
grab the contents?

Also, when I copy/paste the web page into Excel as-is, it puts the whole
darn thing into one cell (one row anyway, and it seems to automatically
merge multiple columns).

When importing each page, I want to pull the "visual" data columns into
separate columns in each XL worksheet. I know if I was importing a flat
file, the import wizard would allow me to do this; can I access the same
functionality directly, or do I need to parse each line as it comes in and
force it into separate columns myself?

Using XL97

Many TIA,
Keith R




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default grab net page, and import as fixed length format

Worked like a charm Tom, thank you!
:-)

Tom Ogilvy wrote in article
...
Try just opening the URL

workbooks.Open Filename:=http://www.someserver.com/somefile

If it puts all the data in one column, just select the data and do
Data=Text to column. This will take you through the text import wizard
after the fact so to speak.

turn on the macro recorder before doing it to get the code.

--
Regards,
Tom Ogilvy



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
Fixed length string of text MWysack Excel Discussion (Misc queries) 7 March 21st 13 12:05 AM
Text to column fixed length Luci Excel Discussion (Misc queries) 6 November 27th 08 06:27 PM
I'd like to have the X-axis a fixed length. Ake Charts and Charting in Excel 0 September 25th 08 05:42 PM
Fixed Length, Text Formatted Novice2000 Excel Discussion (Misc queries) 2 May 13th 08 06:06 PM
fixed length file Steve S[_2_] Excel Discussion (Misc queries) 2 March 13th 07 04:12 PM


All times are GMT +1. The time now is 08:57 PM.

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

About Us

"It's about Microsoft Excel"