Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2006

Tip: Looking for answers? Try searching our database.

Web Query Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PeterJCollins - 27 Dec 2006 12:42 GMT
Hello,

I'm having a difficult time with Web Queries. I have set up a web query
that automatically updates every 10 minutes. I would like to save the
data from each of the updates in a separate sheet. So far I have had no
luck. Can anyone point me in the correct direction?

Thanks in advance.
Nick Hodge - 27 Dec 2006 13:31 GMT
Peter

How are you currently refreshing every 10 minutes?

Signature

HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
www.nickhodge.co.uk

> Hello,
>
[quoted text clipped - 4 lines]
>
> Thanks in advance.
PeterJCollins - 27 Dec 2006 14:03 GMT
I'm using the automatic refresh option.

> Peter
>
[quoted text clipped - 16 lines]
> >
> > Thanks in advance.
Nick Hodge - 27 Dec 2006 14:48 GMT
Peter

You could run the code below (FireRefresh). This then runs the query every
10 minutes to a new worksheet (You will need to record yourself navigating
to your web data and paste that in the querystring. It can have a latest
time set but it will loop otherwise until stops (Bear in mind that this may
error in versions before XL2000 SP2 (I think) as adding sheets may error as
it's code name hits a limit

Sub FireRefresh()
Application.OnTime Now() + TimeValue("00:10:00"), "RefreshAndMove"
End Sub

Sub RefreshAndMove()
ActiveWorkbook.Worksheets.Add
   With ActiveSheet.QueryTables.Add(Connection:= _
       "URL;http://moneycentral.msn.com/detail/stock_quote?Symbol=msft",
Destination _
       :=Range("A1"))
       .Name = "msft"
       .FieldNames = True
       .RowNumbers = False
       .FillAdjacentFormulas = False
       .PreserveFormatting = True
       .RefreshOnFileOpen = False
       .BackgroundQuery = True
       .RefreshStyle = xlInsertDeleteCells
       .SavePassword = False
       .SaveData = True
       .AdjustColumnWidth = True
       .RefreshPeriod = 1
       .WebSelectionType = xlSpecifiedTables
       .WebFormatting = xlWebFormattingNone
       .WebTables = """pgMstr"""
       .WebPreFormattedTextToColumns = True
       .WebConsecutiveDelimitersAsOne = True
       .WebSingleBlockTextImport = False
       .WebDisableDateRecognition = False
       .WebDisableRedirections = False
       .Refresh BackgroundQuery:=False
   End With
Call FireRefresh
End Sub

Signature

HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS
www.nickhodge.co.uk

> I'm using the automatic refresh option.
>
[quoted text clipped - 18 lines]
>> >
>> > Thanks in advance.
PeterJCollins - 27 Dec 2006 14:56 GMT
Thank you for your prompt response. I will try it out.

On Dec 27, 2:48 pm, "Nick Hodge"
<nick_hodgeTAKETHIS...@zen.co.uk.ANDTHIS> wrote:
> Peter
>
[quoted text clipped - 69 lines]
>
> >> > Thanks in advance.- Hide quoted text -- Show quoted text -

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.