I have a macro. I want that before executing macro events and status bar updates should be disabled so that macro could be speed-up. Then enable these when macro is complete. We can easily do this in VBA by following code. But I dont know how to do ths in libreoffice/openoffice basic. Any help will be greatly appreciated.
VBA Code:
Application.DisplayStatusBar = False
Application.EnableEvents = False
'macro code
Application.EnableEvents = True
Application. DisplayStatusBar = True
I want to do the same in libreoffice/openoffice Basic. But unable to find the code for it. Can anyone help?
[Solved] Enable and Disable Events & Updates in Status Bar
[Solved] Enable and Disable Events & Updates in Status Bar
Last edited by Dheeraj on Fri Jul 17, 2020 8:14 am, edited 1 time in total.
Openoffice 4.1
Windows 10
Windows 10
Re: Enable and Disable Events as well as Updates in Status B
To show/hide Statusbar:
https://ask.libreoffice.org/en/question ... o-on-calc/
https://forum-test.openoffice.org/en/fo ... 45&t=97849
Andrew Pitonyak's free macro books always help you:
https://www.pitonyak.org/oo.php
https://ask.libreoffice.org/en/question ... o-on-calc/
https://forum-test.openoffice.org/en/fo ... 45&t=97849
Andrew Pitonyak's free macro books always help you:
https://www.pitonyak.org/oo.php
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Enable and Disable Events as well as Updates in Status B
Code: Select all
Sub YourSubName
Thiscomponent.lockcontrollers
on error goto hr 'to make sure don't get left in a locked state
'your code here
hr:
Thiscomponent.unlockcontrollers
End Sub
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Enable and Disable Events as well as Updates in Status B
Thanks for Replying Zizi64 and JeJe.......
I got the answer of 1st Problem from your replys:
Problem 1 Solution:
VBA:
Application.DisplayStatusBar = False
Application. DisplayStatusBar = True
Libreoffice Basic:
ThisComponent.CurrentController.Frame.LayoutManager.HideElement( "private:resource/statusbar/statusbar" )
ThisComponent.CurrentController.Frame.LayoutManager.ShowElement( "private:resource/statusbar/statusbar" )
Problem 2 Solution:
VBA:
Application.EnableEvents = False
Application.EnableEvents = True
Libreoffice Basic:
I learnt that there is no need of enabling and disabling Events in Libreoffice as Libreoffice automatically disables events while executing any macro. However this is not the case with the VBA. I made a same program in both VBA and Libreoffice Basic and tested it. Locking and unlocking controllers does not make any difference as Libreoffice does not excecute events at all.
Problem 1 is solved.
Please Let me know if I am wrong about what I have learnt regarding Problem 2. Thanks in advanced.
I got the answer of 1st Problem from your replys:
Problem 1 Solution:
VBA:
Application.DisplayStatusBar = False
Application. DisplayStatusBar = True
Libreoffice Basic:
ThisComponent.CurrentController.Frame.LayoutManager.HideElement( "private:resource/statusbar/statusbar" )
ThisComponent.CurrentController.Frame.LayoutManager.ShowElement( "private:resource/statusbar/statusbar" )
Problem 2 Solution:
VBA:
Application.EnableEvents = False
Application.EnableEvents = True
Libreoffice Basic:
I learnt that there is no need of enabling and disabling Events in Libreoffice as Libreoffice automatically disables events while executing any macro. However this is not the case with the VBA. I made a same program in both VBA and Libreoffice Basic and tested it. Locking and unlocking controllers does not make any difference as Libreoffice does not excecute events at all.
Problem 1 is solved.
Please Let me know if I am wrong about what I have learnt regarding Problem 2. Thanks in advanced.
Openoffice 4.1
Windows 10
Windows 10
Re: Enable and Disable Events as well as Updates in Status B
I assumed lockcontrollers would stop status bar updates as well as the component window updates without hiding the status bar but didn't test that. You can also use the status bar to show a progress indicator for your running code:
https://www.openoffice.org/api/docs/com ... cator.html
I suggest you test your code while running with the events you're worried about to see if there are problems.
https://www.openoffice.org/api/docs/com ... cator.html
I suggest you test your code while running with the events you're worried about to see if there are problems.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)