ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disabling effects of cells (temporarily) (https://www.excelbanter.com/excel-programming/345359-disabling-effects-cells-temporarily.html)

booner

Disabling effects of cells (temporarily)
 
I have an odd situation (odd to me anyway) - getting some information from a
database via a macro. The spreadsheet is quite large (many worksheets) -
and when the information is taken from the database and put into the
spreadsheet it is very slow. I tried this same code in a blank spreadsheet
and the performance was very good. So my thought is - the effect of putting
the data into this worksheet (and then Excel updating all of the
worksheets - is the performance problem) - so I was curious if there is a
way to put the data into this worksheet - and disable the effect in Excel of
updating all of the references to this worksheet (cells) - until the
database transaction is complete.

Am I crazy?

BBB



K Dales[_2_]

Disabling effects of cells (temporarily)
 
You could set Calculation to Manual before you refresh and then set it back
on Automatic when done. The basic code would be:

Application.Calculation = xlCalcuationManua
Workbooks("Book1").Worksheets("SheetName").QueryTa bles("QuerytableName").Refresh ' Or whatevery your code is to update your data
.... ' similarly for other querytables
Application.Calculation = xlCalculationAutomatic
--
- K Dales


"booner" wrote:

I have an odd situation (odd to me anyway) - getting some information from a
database via a macro. The spreadsheet is quite large (many worksheets) -
and when the information is taken from the database and put into the
spreadsheet it is very slow. I tried this same code in a blank spreadsheet
and the performance was very good. So my thought is - the effect of putting
the data into this worksheet (and then Excel updating all of the
worksheets - is the performance problem) - so I was curious if there is a
way to put the data into this worksheet - and disable the effect in Excel of
updating all of the references to this worksheet (cells) - until the
database transaction is complete.

Am I crazy?

BBB





All times are GMT +1. The time now is 11:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com