#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Update Web Query

I was trying to use a macro to open a workbook that contains a web query and
then save and close the workbook. However, when I run the query the workbook
closes before the web query is run so the data isn't updated. How can I
delay the macro to allow the query to run correctly?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 185
Default Update Web Query

Rook

You can delay it by running some other dummy code using

Application.OnTime

Placing something like

Application.OnTime Now + TimeValue("00:00:15"), "DummyProcedure"

Will hold the file open for 15 seconds waiting for it to run
'DummyProcedure'

That sub could just be

Sub DummyProcedure()
Msgbox "Data Refreshed"
End Sub

--

HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.nickhodge.co.uk
blog (non tech): www.nickhodge.co.uk/blog


"rook" wrote in message
...
I was trying to use a macro to open a workbook that contains a web query
and
then save and close the workbook. However, when I run the query the
workbook
closes before the web query is run so the data isn't updated. How can I
delay the macro to allow the query to run correctly?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 185
Default Update Web Query

Rook

Let me know if that works, because the code may not stop still on a data
connection but I can't test

--

HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.nickhodge.co.uk
blog (non tech): www.nickhodge.co.uk/blog


"rook" wrote in message
...
I was trying to use a macro to open a workbook that contains a web query
and
then save and close the workbook. However, when I run the query the
workbook
closes before the web query is run so the data isn't updated. How can I
delay the macro to allow the query to run correctly?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Update Web Query

I still didn't work. When I open the other workbook I am asked to enable the
automatic refresh, but when I try to record a macro and look back to see what
was created by the recording I don't see the automatic refresh addressed.

"Nick Hodge" wrote:

Rook

Let me know if that works, because the code may not stop still on a data
connection but I can't test

--

HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.nickhodge.co.uk
blog (non tech): www.nickhodge.co.uk/blog


"rook" wrote in message
...
I was trying to use a macro to open a workbook that contains a web query
and
then save and close the workbook. However, when I run the query the
workbook
closes before the web query is run so the data isn't updated. How can I
delay the macro to allow the query to run correctly?


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
Automatic update through Web query mrbalaje Excel Discussion (Misc queries) 1 August 31st 07 08:09 PM
Software Update INVENTORY Query Carl Hilton Excel Worksheet Functions 1 January 19th 06 03:01 PM
Update Query (minutes into hours) CP Excel Worksheet Functions 1 September 29th 05 10:04 PM
Enable Automatic Update for Web Query Terri Excel Worksheet Functions 0 May 5th 05 11:56 PM
Enable Automatic Update for Web Query Terri Excel Worksheet Functions 0 May 5th 05 11:56 PM


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