I’m running a macro that parses data out of a rather lengthy spreadsheet.
Is there a way to disable the screen from updating until the macro is finished?
This might help speed up the macro.
Examples shown elsewhere say to use
thisComponent.lockControllers
thisComponent.enableAutomaticCalculation(false)
but this does not work on my LibreOffice Version: 6.0.2.1 (x64).
rem ----------------------------------------------------------------------
sub CollectTimeThree
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
dim i
dim args1(0) as new com.sun.star.beans.PropertyValue
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem disable screen updating and disable recalculation
thisComponent.lockControllers
thisComponent.enableAutomaticCalculation(false)
For i = 1 To 150
rem bunch of code here
Next i
rem enable screen updating and enable recalculation
thisComponent.enableAutomaticCalculation(true)
thisComponent.calculateAll
thisComponent.unlockControllers
end sub