[Solved] Hide all columns

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
antipod-sh
Posts: 2
Joined: Fri May 27, 2011 11:05 am

[Solved] Hide all columns

Post by antipod-sh »

Hi! My English is bad, sorry! )
I need to hide first column, but after the code processing all the columns are hiding.

Code: Select all

ServiceManager = CreateObject("com.sun.star.ServiceManager");
Desktop = ServiceManager.createInstance("com.sun.star.frame.Desktop");
Document = Desktop.LoadComponentFromURL("private:factory/scalc", "blank", 0, Array);
Sheets = Document.getSheets();
Sheet = Sheets.getByIndex(0);
Col = Sheet.Columns(0);
Col.IsVisible = 0;
1c7.7 -> OpenOffice 3.1
Last edited by antipod-sh on Sat May 28, 2011 7:25 am, edited 1 time in total.
OpenOffice 3.1 on Windows Server 2003
FJCC
Moderator
Posts: 9273
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Hide all columns

Post by FJCC »

The syntax Columns(0) is an OOo Basic shortcut for Columns.getByIndex(0). Does this version work?

Code: Select all

ServiceManager = CreateObject("com.sun.star.ServiceManager");
Desktop = ServiceManager.createInstance("com.sun.star.frame.Desktop");
Document = Desktop.LoadComponentFromURL("private:factory/scalc", "blank", 0, Array);
Sheets = Document.getSheets();
Sheet = Sheets.getByIndex(0);
Col = Sheet.Columns.getByIndex(0);
Col.IsVisible = 0
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
antipod-sh
Posts: 2
Joined: Fri May 27, 2011 11:05 am

Re: Hide all columns

Post by antipod-sh »

FJCC wrote:The syntax Columns(0) is an OOo Basic shortcut for Columns.getByIndex(0). Does this version work?

Code: Select all

Col = Sheet.Columns.getByIndex(0);
Big thanks! It's work!
OpenOffice 3.1 on Windows Server 2003
Post Reply