none
Bug in Project 2013 when turning off screenupdating in vb RRS feed

  • Question

  • Below a short (3-line) piece of code that turns off screen updating, applies the "Gantt Chart" view (though any view or table produces the same effect), then turns screen updating on again.

    When you run the code, the result is all task names and gantt chart bars disappear - only the dependencies remain in the Gantt chart. making ScreenUpdating = True restores them again.

    Has anyone else seen this potentially major bug? It seems like turning screen updating on again after turning it off doesn't refresh the screen.

    Sub screen_updating_problem()
        ' Make the next line "True" to fix the problem, i.e. not update the screen
        ScreenUpdating = False

        ViewApply "Gantt Chart"

        ScreenUpdating = True
    End Sub

    Saturday, February 15, 2014 2:15 AM

All replies

  • I confirm this looks "awkward"! Work around is to change views once ScreenUpdating is true. As there is a workaround I doubt a fix will be high priority. If this is breaking existing code for you, then submit a support request with Microsoft.

    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

    Saturday, February 15, 2014 9:49 PM
    Moderator
  • Thanks Rod. I can confirm the workaround is to re-apply the current View, but as we have thousands of lines of code with the screen turning on/off at appropriate times, it's not just a simple fix. I have made the change but it still looks odd, since making "ScreenUpdating = True" momentarily displays the Gantt and Table with the odd look (missing bars and missing text in the Table) before the new current View is applied. It's not that it can't be done but it's not pretty for the use experience to see it "flashing".

    This seems a pretty fundamental problem and I would hope Microsoft includes a fix for the next Service Pack. I can't be the only person seeing this problem.

    I did submit a support request and they referred me to this group!

    Sunday, February 16, 2014 7:53 PM
  • lateralworks,

    Pardon my bumping in but it seems this would only be an issue when using foreground processing (i.e. operating on selected objects). Is there a reason why you can' t use background processing (i.e. operating directly on Project's underlying objects)? Granted, some operations in Project can only be done using foreground processing (e.g. font characteristics).

    John

    Sunday, February 16, 2014 8:20 PM
  • Yes, this is what we do most of the time. However, one example is sometimes we need to open all tasks before applying a filter or changing View. Sometimes we need to change views or edit the current table.

    In these cases (where the View, Table and/or Filter is changed) we turn ScreenUpdating off so:

    1. The code runs faster (all these operations appear instant) and

    2. The user can't see the screen change while Views and Filters are being applied.

    Sunday, February 16, 2014 8:31 PM
  • lateralworks,

    Sorry for my thickheadedness but what exactly do you "do most of the time"?

    I've never had a need to stop screen updating in Project, although I've often done it in Excel while transferring data from Project. If the workaround suggested by Rod is not a viable option then it would help us a lot to better understand your end goal (i.e. what is your file structure and what does your macro do). Also, are you in a Project Server environment?

    John

    Sunday, February 16, 2014 10:27 PM
  • Regardless of the need to turn screen updating off and on, clearly it's not working and it's a bug. This is my point.

    If I turn screen updating off, change the view, then turn it on again, regardless of whether this is needed or not, turning it back on removes the Gantt bars and text in the tables. This should not happen.

    Let me give you an example:

    1. Open all tasks (removing the filter and opening all summaries)

    2. Close the lower pane

    3. Go through a set of operations to determine the 1st, 2nd, 3rd, etc. critical paths from a selected milestone

    4. Add a column to the table

    5. Filter on the critical path to the selected milestone

    If I do this when screen updating is on (especially in step 3), the user can see each step of the process. We don't want this. We want to turn screen updating off so the next thing the users sees is the result, and non of the intermediate operations that involves changes to the screen. Turning screen updating off while it goes through each step makes each step also makes it run faster, because the screen doesn't have to be updated.

    What we are doing is relatively complex. Again, right or wrong, turning screen updating on after being off doesn't behave correctly.

    Sunday, February 16, 2014 11:26 PM
  • lateralworks,

    Yes, I understand that but please understand that not all bugs will get fixed - it just an unfortunate fact of life. If your company has a support contract with Microsoft, then you should be able to get a hotfix for this problem. However you indicated you submitted a request to Microsoft and they referred you to this forum. That suggests your company does not have a support contract with Microsoft. To be honest, the type of problem you are experiencing doesn't sound like something many users are going to run into so the likelihood of getting it fixed is slim, but that's just my opinion.

    I know this isn't the type of answer you want, and it is still possible someone else will post a better idea, but for now, I'd go with the workaround and/or review your end goal and modify your process to find a better solution.

    John

    Monday, February 17, 2014 1:43 AM
  • Well, after all of this discussion I've figured out what the problem is. Thank you for contributing to the discussion as it drove me to dig deeper.

    Turns out MS Project 2013 (in fact, MS Office 2013 in general), requires DirectX10 that it uses for 3D hardware acceleration. I am using VMWare on a Mac, and VMWare only supports DirectX9 - hence a problem with the screen updating.

    By disabling 3D acceleration in VMWare and and disabling hardware acceleration in MS Project 2013 it works fine.

    Thanks again,

    Mark

    Monday, February 17, 2014 5:17 AM
  • Mark,

    You're welcome, I'm glad you figured it out. I guess you can give yourself credit for answering this one. I doubt any of us would have figured it out.

    John

    Monday, February 17, 2014 5:18 PM
  • I spoke to soon. I've had others verify with DirectX10 not running on an emulator and still the same problem. Seems the problem is something else...!

    Mark

    Monday, February 17, 2014 11:48 PM
  • Mark,

    So.....the plot thickens. However, I thought you said you resolved the issue for yourself by disabling hardware acceleration. If that's the case, I'd count my blessings and go with it.

    Just for reference I've run into a few little glitches like this over the years with Project. It's nice if they get fixed, but many times they do not so I focus on the best workaround and go with it.

    John

    Tuesday, February 18, 2014 4:29 PM
  • I hope Microsoft is watching this because the screen corruption seems to be a big problem. I can't understand why nobody else has seen it. I just got a new laptop with a fresh install with all the latest updates of MS Project and it still remains.

    Would love to know if anyone is seeing the same thing (use the code above).

    Wednesday, June 11, 2014 10:01 PM
  • Many visual bugs are caused by video card drivers, so do you have the latest video driver? Do you have SP1 for Project 2013 installed?

    These won't remove the original bug, but they may help fix other screen issues.

    Many visual bugs are caused by video card drivers, so do you have the latest video driver? Do you have SP1 for Project 2013 installed?

    These won't remove the original bug, but they may help fix other screen issues.

    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

    Saturday, June 14, 2014 4:43 AM
    Moderator
  • Thanks for your reply Rod. I've tried this on multiple machines (one which is brand new). I have seen this effect on other people's machines I've tried it on. I also have all the latest updates of everything.

    I do not see the problem with 2010 but I do with 2013. This makes me suspect it is a MS Project 2013 problem.

    The code is very simple (see start of posting) - do you see the effect (assuming you have MS Project 2013)?

    Mark

    Monday, June 16, 2014 4:01 PM
  • I think one of the other problems is ScreenUpdating = False is not fundamentally working. Even when I set it to False, I still see the screen changing. Again, I don't see it changing in 2010, so it seems to be a problem with the ScreenUpdating = False.
    Monday, June 16, 2014 4:22 PM
  • I agree, Screenupdating=false does appear to be the culprit. However I've found the following code works (Project 2013 SP1) as it forces the screen to refresh:
    Sub screen_updating_problem()
        ' Make the next line "True" to fix the problem, i.e. not update the screen
        ScreenUpdating = False
        ViewApply "Gantt Chart"
        ScreenUpdating2013
    End Sub

    Sub ScreenUpdating2013()
    Dim OldID As Long
        OldID = ActiveCell.Task.ID
        EditGoTo ID:=OldID + 50
        EditGoTo Date:="1/1/2010"
        EditGoTo ID:=OldID
        ScreenUpdating = True
    End Sub

    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

    Monday, June 16, 2014 9:03 PM
    Moderator
  • Nice idea Rod. However...when I run it, it does indeed fix the problem on the first run. However, when I immediately run it again, i get the corruption, and I seem to have to run it several times (4-8x on average) before the screen is correctly refreshed.

    There seems to be 2 problems here:

    1. ScreenUpdating = False does not turn off ScreenUpdating

    2. When you set ScreenUpdating to False, do something, then set it back to True, both the Table and Gantt chart get corrupted.

    My point 1 can easily be seen here (all tasks must be visible). In 2010, ScreenUpdating is turned off, i.e. no movement is visible. In 2013, you can see the movement when ScreenUpdating is turned off as it goes to each task.

    Sub ScreenUpdating()
        Dim t As Task
     
        ScreenUpdating = False

        For Each t In ActiveProject.Tasks
            EditGoTo t.ID
        Next t

        ScreenUpdating = True
    End Sub

    Thursday, June 19, 2014 3:42 PM

  • I can run the macro as many times as I like and it doesn't corrupt. Project 2013 SP1 no cumulative updates.

    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

    Friday, June 20, 2014 9:09 AM
    Moderator