How to hide the active sheet grid lines?

Creating a macro - Writing a Script - Using the API
Post Reply
eeigor
Posts: 210
Joined: Sun Apr 12, 2020 10:56 pm

How to hide the active sheet grid lines?

Post by eeigor »

Is there a replacement for the Uno-method of dispatcher?

Code: Select all

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.3.5.2 Community
User avatar
Zizi64
Volunteer
Posts: 10688
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to hide the active sheet grid lines?

Post by Zizi64 »

Tibor Kovacs, Hungary; LO6.1.6, 6.4.7 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.3.5;AOO4.1.13
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: 10688
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to hide the active sheet grid lines?

Post by Zizi64 »

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.3.5;AOO4.1.13
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: 10688
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to hide the active sheet grid lines?

Post by Zizi64 »

Tibor Kovacs, Hungary; LO6.1.6, 6.4.7 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.3.5;AOO4.1.13
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.
eeigor
Posts: 210
Joined: Sun Apr 12, 2020 10:56 pm

Re: How to hide the active sheet grid lines?

Post by eeigor »

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.3.5.2 Community
Post Reply