| View previous topic :: View next topic |
| Author |
Message |
christopher23 General User

Joined: 25 Feb 2010 Posts: 19
|
Posted: Thu Mar 18, 2010 6:25 am Post subject: get number of columns |
|
|
Hello,
Is their some function that allows you to get the number of columns? I don't mean column separators.
Because if I have 9 column separators it would mean I'd have 10 columns.. the number 10 is what I would like to get.
Any help is appreciated.. |
|
| Back to top |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8995 Location: Lexinton, Kentucky, USA
|
Posted: Thu Mar 18, 2010 8:11 am Post subject: |
|
|
| Code: | Sub ColumnCount
oSheet = ThisComponent.CurrentController.ActiveSheet
oRange = oSheet.getCellRangeByName("A1:Z50")
Print oRange.Columns.Count
oRange = oSheet.getCellRangeByName("MyRange")
Print oRange.Columns.Count
End Sub |
|
|
| Back to top |
|
 |
christopher23 General User

Joined: 25 Feb 2010 Posts: 19
|
Posted: Fri Mar 19, 2010 2:23 am Post subject: |
|
|
Thanks JohnV,
apparently this works to:
| Code: | table = document.createInstance("com.sun.star.text.TextTable")
remainingCols = table.Columns.Count |
but wouldn't of know that Columns.Count worked unless you told me.
So thank you for that. |
|
| Back to top |
|
 |
|