Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 142
Default Get source from a web page into a worksheet

I have often written macros that import data from a web page into a
worksheet. Now I need to get the source code from the web page into the
worksheet. (The source is what you get when, in Internet Explorer, you
right click on a page and selece "view source".)

Is there any way I can do this?

Many thanks for any help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default Get source from a web page into a worksheet

NS

Here's a sub that will get the HTML between the body tags.

Sub GetSource()

Dim ieApp As InternetExplorer

Set ieApp = New InternetExplorer

ieApp.Navigate "http:\\www.dicks-clicks.com"
Do
Loop Until ieApp.ReadyState = READYSTATE_COMPLETE

Debug.Print ieApp.Document.body.innerhtml

End Sub

That won't be everything you get when you View Source, but it's a start.
Check here

http://msdn.microsoft.com/library/de...s/document.asp

for documentation on the Document object and maybe you can find something to
get what you want.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

wrote in message
...
I have often written macros that import data from a web page into a
worksheet. Now I need to get the source code from the web page into the
worksheet. (The source is what you get when, in Internet Explorer, you
right click on a page and selece "view source".)

Is there any way I can do this?

Many thanks for any help.



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
creating drop down lists from source on another page Shaun Excel Worksheet Functions 7 March 12th 10 07:37 PM
Display the source for a pivot table page field Gary Brown Excel Worksheet Functions 4 November 8th 06 03:02 PM
EXCEL - Auditing - TRACE to show source from another page Tuba Joe Excel Worksheet Functions 1 September 30th 05 02:06 AM
Converting a muliple page worksheet to a single page worksheet [email protected] Excel Discussion (Misc queries) 2 June 30th 05 09:40 PM
Viewing source code when saved as web page Mark Excel Discussion (Misc queries) 1 March 31st 05 06:26 AM


All times are GMT +1. The time now is 03:05 AM.

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"