dss28

Board Regular
Joined
Sep 3, 2020
Messages
61
Office Version
  1. 2007
Platform
  1. Windows
i have a program which has few sheets very hidden,

my program is running very slow and hence i am using following code at the start of the Sub or Private Sub

Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
Application.EnableEvents = False
ActiveSheet.DisplayPageBreaks = False

and following code at the end of the code
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.DisplayStatusBar = True
Application.EnableEvents = True
ActiveSheet.DisplayPageBreaks = True


even then my program is very slow and the screen flickers or if clicked anywhere on the form during this, the form goes blank / white and after 10-20 seconds, the code is executed.

my questions are:

1. since the sheets are very hidden on to which the data is getting stored, is it hindering the process and delaying the code execution?
2. Is any of the false and true application events as above hindering the speed of the code?
3. Am i required to add / delete any of the above application true / false codes??

please help
 

Some videos you may like

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Zot

Well-known Member
Joined
Nov 26, 2020
Messages
919
Office Version
  1. 2016
Platform
  1. Windows
The very hidden sheet does not affect execution speed.

In my experience Application.ScreenUpdating = False during execution will negate under certain condition. I cannot recall due to what. This is why you get flickers. Some suggest using Windows API but you can get away by putting the same command line at specific location.

I think this is the main cause of your problem
 

dss28

Board Regular
Joined
Sep 3, 2020
Messages
61
Office Version
  1. 2007
Platform
  1. Windows
thanks for the prompt reply
1) should I add the Application.ScreenUpdating = False line in between the code lines, particularly where? -- after the codes performing calculation etc??
2) I am not aware of Windows API -- very new to vba / excel - request you to please guide
 

Zot

Well-known Member
Joined
Nov 26, 2020
Messages
919
Office Version
  1. 2016
Platform
  1. Windows
thanks for the prompt reply
1) should I add the Application.ScreenUpdating = False line in between the code lines, particularly where? -- after the codes performing calculation etc??
2) I am not aware of Windows API -- very new to vba / excel - request you to please guide
I'm no expert either

I think if you performing copy paste between workbooks, the Application.ScreenUpdating = False will not longer work. It is hard to know because you cannot go step by step using F8. I think once you on pause on VBA Editor, the status is always True.

I am hoping someone with experience on this will reply to this. I'm in the dark myself on this subject 😅
 

Watch MrExcel Video

Forum statistics

Threads
1,126,957
Messages
5,621,822
Members
415,859
Latest member
Vain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top