LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default macro to disable auto refresh

Patrick,
I apologize for the delay. I'm not sure what causes the prompt,
because, like you, I see the prompt regardless of the setting in the
data range properties. I wish I could be more help. I'll keep an eye
out for a solution. If I find anything, I'll post it here.

On Aug 31, 2:26 am, Patrick Bateman
wrote:
Thank you Jason, i dont really want to change the registry setting, but am
thinking does it even matter what is chosen in the prompt ? as when i look at
the data range properties after "enable automatic refresh" is selected it is
still set to not enable auto refresh or refresh on file open?

Regards

Patrick

"Jason" wrote:
Now that I reopened the sample workbook I created yesterday, I see
what you're talking about. Unfortunately, I don't know how to disable
that. I found an article in the Microsoft help site, but I don't know
that it will help unless you want to change a registry setting.
Here's the URL, just in case:
http://support.microsoft.com/kb/248204/zh-cn


Another option I thought of was using a new workbork that's linked to
the workbook with the queries. To disable the external links startup
dialog, click Edit -- Links and then in the Edit Links dialog, click
the Startup Prompt button in the bottom left.


Hope this helps
Jason


On Aug 30, 5:12 am, Patrick Bateman
wrote:
Tom and Jason,


thankyou both for your help, both methods work in changing the refreshing of
the data, but when the file is re opened the "enable autorefresh" or "disable
auto refresh" box still appears. Any ideas?


Thank You


Patrick


"Jason" wrote:
Patrick,
It sounds like you could deselect the 'Refresh data on file open'
option on all your queries by selecting one of the cells in the
external data range and using the menu Data -- Import External Data --
Data Range Properties. Then you could manually refresh them with
the menu Data -- Refresh Data. I think one of the standard buttons
on the External Data toolbar is a Refresh All button, which should
allow you to update all the queries at once.


If you'd rather use vba to disable the 'Refresh data on file open'
option, I think this would work:


Dim WkSht, Qt


With ActiveWorkbook
For Each WkSht In .Worksheets
For Each Qt In WkSht.QueryTables
Qt.RefreshOnFileOpen = False
Next
Next
End With


You could make another similar macro that would refresh all of the
queries:
Dim WkSht, Qt


With ActiveWorkbook
For Each WkSht In .Worksheets
For Each Qt In WkSht.QueryTables
Qt.RefreshOnFileOpen = False
Next
Next
End With


Hope this helps
Jason


On Aug 29, 10:48 am, Patrick Bateman
wrote:
Tom i am not using a periodic refresh, but if i did, does it only refresh
when the file is open? ie. if it was set to 0 it would not refresh and
otherwise would always refresh at the set interval even when the file is
closed?


It might help you to know what i am doing to understand what i mean.......
i have a file with several data queries which refresh when the file is
opened and viewed, every month targets are set against the data pulled
through in the query and are left to be reviewed by the managers, so at this
point the data is not needed to update as it needs to be the same as it was
at the time the targets were made, after the reviewed it then needs to go
back to updating again. All this needs to be done "at the push of a button"


Thankyou for all your help


Regards
Patrick


"Tom Ogilvy" wrote:
If you are using a periodic refresh


for each sh in worksheets
for each qt in sh.QueryTables
qt.RefreshPeriod = 0
Next
Next


--
Regards,
Tom Ogilvy


"Patrick Bateman" wrote:


i have tried this a couple of times and it keeps causing excel to crash just
after i turn off the auto refresh?


"Tom Ogilvy" wrote:


Turn on the macro recorder and do it manually to one of your queries.


then turn off the macro recorder and look at the code recorded.


--
Regards,
Tom Ogilvy


"Patrick Bateman" wrote:


sorry i'm looking to disable the automatic refresh on a database query i have
in my sheet


"ddiicc" wrote:


Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic


This is stop screen updating while running macro and will actually speed up
the macro by 80%. If you want screen updating, just change the FALSE to TRUE


"Patrick Bateman" wrote:


hi


is it possible to run a macro to disable/enable the automatic refresh on all
queries in a workbook?


thankyou- Hide quoted text -


- Show quoted text -



 
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
Macro for auto refresh Kim Excel Discussion (Misc queries) 1 October 6th 09 02:22 PM
Running a macro from an auto-refresh Chris Youlden Excel Worksheet Functions 2 October 7th 07 04:22 PM
Disable Auto Refresh Dialog Atchleykl Excel Programming 0 September 13th 06 05:20 PM
Auto-run macro after auto-query refresh (Excel2000,sr1) Bill Cufflin Excel Programming 3 June 29th 06 03:30 AM
Macro Auto-refresh? Marty Reinders Excel Programming 0 August 4th 03 07:21 PM


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