How to hide the active sheet grid lines?

Creating a macro - Writing a Script - Using the API

How to hide the active sheet grid lines?

Postby eeigor » Sun Apr 11, 2021 11:31 am

Is there a replacement for the Uno-method of dispatcher?
Code: Select all   Expand viewCollapse view
Sub ToggleSheetGrid
   Dim document As Object, dispatcher As Object

   document = ThisComponent.CurrentController.Frame
   dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
   dispatcher.executeDispatch(document, ".uno:ToggleSheetGrid", "", 0, Array())
End Sub


How do I know if the active sheet grid lines are currently displayed?

An example of a non-uniform approach.
E.g. Why it affects all sheets:
>>> ThisComponent.CurrentController.ShowGrid = True
And this one only for the active sheet:
>>> ThisComponent.CurrentController.freezeAtPosition(0, 1)
Ubuntu 18.04 LTS • LibreOffice 7.2.1.2 Community
eeigor
 
Posts: 184
Joined: Sun Apr 12, 2020 10:56 pm

Re: How to hide the active sheet grid lines?

Postby Zizi64 » Sun Apr 11, 2021 11:48 am

Tibor Kovacs, Hungary; LO6.1.6, 6.4.7 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.1.1;AOO4.1.9
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.
User avatar
Zizi64
Volunteer
 
Posts: 10010
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to hide the active sheet grid lines?

Postby Zizi64 » Sun Apr 11, 2021 11:52 am

A workaround tip:

Use Cell styles with colorized cell background (at least with white color), then the grid lines will be invisible on the sheet.

(Or just use the Dispatcher method)
Tibor Kovacs, Hungary; LO6.1.6, 6.4.7 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.1.1;AOO4.1.9
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.
User avatar
Zizi64
Volunteer
 
Posts: 10010
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to hide the active sheet grid lines?

Postby Zizi64 » Sun Apr 11, 2021 12:48 pm

Tibor Kovacs, Hungary; LO6.1.6, 6.4.7 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.1.1;AOO4.1.9
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.
User avatar
Zizi64
Volunteer
 
Posts: 10010
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to hide the active sheet grid lines?

Postby eeigor » Sun Apr 11, 2021 6:22 pm

ThisComponent.CurrentController.ShowGrid = True
This looks like a 10 year-old bug.
ODS's file 'settings.xml' contains the 'ShowGrid' property for each sheet.
<config:config-item config:name="ShowGrid" config:type="boolean">true</config:config-item>
Ubuntu 18.04 LTS • LibreOffice 7.2.1.2 Community
eeigor
 
Posts: 184
Joined: Sun Apr 12, 2020 10:56 pm


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 3 guests