Page 1 of 1

[Solved] Hide all columns

Posted: Fri May 27, 2011 1:27 pm
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

Re: Hide all columns

Posted: Fri May 27, 2011 2:26 pm
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

Re: Hide all columns

Posted: Sat May 28, 2011 7:22 am
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!