Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to execute at a set time, pull data off of a web page, and e

I am sending out nightly reports on data collected from a web page. I have a
spreadsheet set up so all I need to do is pull the data off line and drop it
into the page, but I would love to be able to run a macro to pull down the
data, break up the spreadsheet and email it out. If I could make it run
automatically this would be even better.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 257
Default Macro to execute at a set time, pull data off of a web page, and e

If you don't mind parsing the raw HTML, getting the page is pretty easy:

set net = CreateObject("InetCtls.Inet")
net.RequestTimeout=30
net.URL="http://www.altavista.com/"
sHTML=net.OpenURL

sHTML now equals a long HTML string, which you can munge to your heart's
content. If you need to, you can also access the document using the IE
document model; it's much more complicated but also gives you a lot more
control. But you don't need control, I expect, you just need to be able to
extract data from the HTML.

This is VBS code, so you should be able to schedule it to run after hours
too. (You could do it in VBA/Excel, but it would require you to leave a VBA
macro running when you go home, the macro to keep running until it sees that
the time has come and finish the job itself. But this you can set up in
VBScript and then have your Windows scheduler just run it at the proper time
of night; VBScript can then load up Excel, load the data into a worksheet and
save it, email it, whatever.

--- "Roger Brown" wrote:
I am sending out nightly reports on data collected from a web page. I have a
spreadsheet set up so all I need to do is pull the data off line and drop it
into the page, but I would love to be able to run a macro to pull down the
data, break up the spreadsheet and email it out. If I could make it run
automatically this would be even better.

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
Tweaking to pull a local HTML page instead of a server page? JP[_4_] Excel Programming 0 February 20th 08 03:17 PM
Macro to pull info from html page Mex Excel Discussion (Misc queries) 0 April 17th 07 09:52 PM
is there a way to schedule a macro to execute at a certain time? Colibri_2 Excel Discussion (Misc queries) 4 February 13th 07 09:00 PM
Why can't a calculation and macro execute at the same time? Katy[_3_] Excel Programming 9 June 15th 04 03:17 PM
How to execute a macro when data in a pivotchart changes? TNandSEC Excel Programming 2 June 4th 04 08:01 PM


All times are GMT +1. The time now is 10:18 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"