Screen freeze

  • 1
  • Question
  • Updated 11 months ago
I have a large map with macros to analyse content. How can I freeze the screen while the macro runs? Something similar to Application.ScreenUpdating=False in VBA, perhaps?
Photo of David

David

  • 2 Posts
  • 0 Reply Likes

Posted 11 months ago

  • 1
Photo of aHa!Coaching

aHa!Coaching, Champion

  • 1192 Posts
  • 116 Reply Likes
It depends, how is the macro traversing the map? Is it making any modifications to the map?
Photo of David

David

  • 2 Posts
  • 0 Reply Likes

it is traversing the map but seemingly randomly from top to bottom and between different levels. This means the screens jumps around while the macro executes, hence the question about not updating the screen until the macro finishes as in .ScreenUpdating=false in VBA.

Any suggestions welcome. Thanks

Photo of aHa!Coaching

aHa!Coaching, Champion

  • 1192 Posts
  • 116 Reply Likes
If your macro is modifying something in this map, I think there's a way to postpone the updates on the map by combining them in one 'transaction' and then commit the changes of the transaction at the end of the macro.

Normally travering the map should not be visible, for example when using a function like this one:

Sub Main
   Dim t As Topic
   Set t = ActiveDocument.VisibleCentralTopic
   traverseMap(t)
End Sub

Sub traverseMap(t As Topic)
    Dim currenSubtopics As Topics
    Set currentSubtopics = t.SubTopics

    For Each currentTopic In currentSubtopics
        traverseMap(currentTopic)
    Next
End Sub