VBA - chart/screen flickering after xlSheetVisible = True

Piotr Kalinowski

New Member
Joined
Apr 10, 2020
Messages
1
Office Version
  1. 2013
Platform
  1. Windows
I've got a problem and really need some help from you. I was trying to google the solution, but found nothing useful. My macro runs by clicking on a commandbutton1 which is located on sheet1. Important detail: a chart is also located on sheet1.

The only thing the macro does is switching sheet2 from 'hidden' to 'visible'.

VBA Code:
Sub abc()

    Sheets(2).Visible = Not Sheets(2).Visible

End Sub

THE PROBLEM: after switching the sheet2 from hidden to visible the screen is flickering.

Notes:

  1. The problem occurs only on the sheets with charts. It seems like excel is doing some chart update.
  2. It occurs only when sheet2 is being switched to "visible".
  3. I've tried:
VBA Code:
   Application.EnableEvents = False
   Application.ScreenUpdating = False
   Application.DisplayStatusBar = False
   Application.Calculation = xlCalculationManual
  1. I deleted any other macros and events in the workbook.
  2. I've tried to run a macro directly from VBA editor (not via commandbutton1).
  3. I've tried debugging step by step.
Is there anyone who can help me with this issue?
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
1. The problem occurs only on the sheets with charts. It seems like excel is doing some chart update.
2. It occurs only when sheet2 is being switched to "visible".

It looks to me like excel does a screen refresh when a page becomes visible. Any sheet, not just the ones with shapes (a chart is also a shape). Even on an empty worksheet you can see the selected cell flicker briefly. It's just that it is more a lot more noticeable on sheets that have shapes on them because it looks like all shapes get repainted. I'm not sure there is much that can be done about that.
 
Upvote 0

Forum statistics

Threads
1,215,009
Messages
6,122,674
Members
449,091
Latest member
peppernaut

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
Back
Top