+ Reply to Thread
Results 1 to 5 of 5

Excel fail to refresh (repaint) when activating worksheet

  1. #1
    Registered User
    Join Date
    12-07-2021
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    5

    Excel fail to refresh (repaint) when activating worksheet

    Hi,
    I have a problem that occured a few weeks ago, and I can't find a way to fix it, hope someone can bring ligth.
    In a very VBA intensive workbook, some sheets fail to refresh completely when selected. Part of the sheet, and sometimes the worksheet tabs are greyed out. The worksheet_activate events are triggering a lot of code.

    Clicking inside the sheet always causes immediate refresh, and things are ok. For some reason hovering the mouse inside the sheet causes refresh within a few seconds. Doing nothing causes the sheet/application to stay greyed out. The functionality is not affected.

    Greyed out means opaque, rectangular grey panels covering parts of the application, it is not the kind of greyed out as appears in inactive menus or the ligth grey fog that covers the application in cases where it becomes unresponsive. It is opaque, grey areas that will disappear with a click of the mouse.

    Please see the attachment, the problem will be clearer, I'm unable to explain accurately in plain words.
    Wrt the attachement, (1) many sheet tabs missing (including half of the blue "Risk Register" tab, (2) "static" content in sheet header and some column headers greyed out, (3) some columns including half of "E" col greyed out in listobject. The visible content to the right is as it should be.

    This behavior is not repeatable, some of the time there are no issues.

    And for the sake of it, I don't think it to do with application.enableevens or application.screenupdating etc being applied in the wrong direction.

    Using latest version Microsoft365.

    Any tips are appreciated:-)
    Attached Images Attached Images
    Last edited by Thor99; 02-04-2023 at 01:34 PM. Reason: Completed some content.

  2. #2
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Excel fail to refresh (repaint) when activating worksheet

    This can happen with extensive event code, where it eats up significant memory.

    What is the memory usage of excel when this is running? You can see this in Task Manager.
    <<< If you have valued anyone's contributions in this thread, please click * to thank them for their efforts

  3. #3
    Registered User
    Join Date
    12-07-2021
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Excel fail to refresh (repaint) when activating worksheet

    Hi,

    Thank you for your answer.

    The memory use is not extensive. I have done a lot of testing to try to find an explanation.
    Regarding the "grey out" of part of the screen I now tend to think it has to do with hardware/graphics refresh or something not related to Excel VBA. I am now running the application without (almost) issues on a Thinkpad 490s, a moderately speced business machine. The "grey out" appears on my stationary machine, which is a very high-performance computer compared to the laptop. There are a lot of users of the app, none have reported grey outs, only flickering.

    I also found that the trigger point for the erratic screen updating is when a worksheet other than the activesheet is unprotected in code. I.e Sheet1 is active, unprotecting Sheet2 causes flickering/grey out.
    This flickering is much more prenounced on the Thinkpad, I guess slower execution makes it more visible. It is especially shapes (which is used for buttons) that will dis/reappear.

    Obvious solution is to not unprotect inactive sheets, but not always desireable.

    So since I after extensive searching can not find anything related to or simlar to the "grey out" issue, I'll let it rest and write it off as hardware related. May take a dive into hardware/drivers/settings if the issue continues and gets on my nerves again:-)

  4. #4
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Excel fail to refresh (repaint) when activating worksheet

    Right - that makes sense.
    Difficult too help further without seeing the code, but there are various code efficiencies that can help (e.g. not 'activating' sheets through code, instead of keeping the current worksheet active and carefully referencing them instead) etc

  5. #5
    Registered User
    Join Date
    12-07-2021
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Excel fail to refresh (repaint) when activating worksheet

    Hi,
    Thanks, but I do think the original problem could be dismissed as not being a VBA related problem.

    The second issue I mentioned I see is adressed (without a solution??) other places on the net. (flickering shapes)

    I am aware of the activate/select issues, and avoid them. In this application the data is mainly stored in tables hidden from the user, a couple of dedicated sheets work as user interface. The users are to a large extent unknown to me, so I do not dare to leave data tables unprotected, hence unprotect/write/protect in background.

    If there is a solution to shapes dis/reappearing during bacground unprotect operations, I will certainly appreciate you sharing it:-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Paste to another worksheet without activating still activating it if.....
    By karmapala in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-16-2018, 03:29 PM
  2. Replies: 4
    Last Post: 12-28-2017, 11:46 AM
  3. Replies: 3
    Last Post: 12-23-2016, 12:18 PM
  4. Screen Refresh/Repaint in VBA
    By drobles in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-19-2015, 12:27 AM
  5. Replies: 2
    Last Post: 02-22-2012, 08:13 AM
  6. Replies: 1
    Last Post: 02-21-2012, 05:40 PM
  7. Activating a Procedure in an Excel Worksheet
    By alathosco in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-27-2005, 09:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1