Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default macro to disable auto refresh

hi

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

thankyou
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default macro to disable auto refresh


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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default macro to disable auto refresh

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default macro to disable auto refresh

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default macro to disable auto refresh

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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default macro to disable auto refresh

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

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
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 11:14 AM.

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"