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

Joined: 23 Apr 2005 Posts: 10
|
Posted: Sat Apr 23, 2005 1:38 pm Post subject: How to get list of existing named cell |
|
|
Hi,
I try to find some examples that return list of named cells in a Calc spreadsheet.
I tried something like :
oSheet.getNames().getElementNames()
oSheet.getCellNames().getElementNames()
but I couldn't find exact syntax.
I know how to read/write named cell but I couldn't get list of existing names.
Can you help me ? or provide me link where to find api of existing methods.
Thanks
Michel |
|
| Back to top |
|
 |
Danad OOo Advocate

Joined: 22 Feb 2004 Posts: 293 Location: Brasil
|
Posted: Sat Apr 23, 2005 2:59 pm Post subject: |
|
|
Here's for NamedRanges not DatabaseRanges:
| Code: |
Sub getNamedRanges
Dim oDoc As Object
oDoc = ThisComponent
oRanges = oDoc.NamedRanges
Nomes = oRanges.getElementNames()
msg=""
For i=LBound(Nomes) To UBound(Nomes)
msg=msg+Nomes(i)+chr(10)
Next i
MsgBox msg
End Sub
|
HTH |
|
| Back to top |
|
 |
mcharp General User

Joined: 23 Apr 2005 Posts: 10
|
Posted: Sun Apr 24, 2005 8:09 am Post subject: |
|
|
Thanks
this is exactly what I was looking for. That works fine.
Additional question:
Where could I find all methods managed by "ThisComponent"
I tried to search in api, but i couldn't find any list of supported methods like "NamedRanges", for example.
I tried also to type in Calc macro editor, ThisComponent. (dot) to get list of object methods (like in VB) but editor doesn't seem to support introspection for object methods.
Could you confirm me that this doesn't work in oooBasic editor.
Michel |
|
| Back to top |
|
 |
Danad OOo Advocate

Joined: 22 Feb 2004 Posts: 293 Location: Brasil
|
Posted: Sun Apr 24, 2005 5:56 pm Post subject: |
|
|
Quick way:
| Code: |
msgBox object.Dbg_SupportedInterfaces
msgBox object.Dbg_Properties
msgBox object.Dbg_Methods
|
Best way:
1)Download SDK and expand it ( you don't need to install it )
2)Goto www.ooomacros.org, get, install and configure XRay tool
SDK comes with Reference and Developer's Guide (hard, but the best).
Others:
1) Excel/VBA to Calc/Basic: www.oooforum.org/forum/viewtopic.phtml?t=8833
2) Take a look here into CodeSnippets forum, it's very good
3) Download Andrew Pitonyak Free Document ( www.pitonyak.org )
And, we haven't yet some facilities found into some commercial IDEs.
HTH |
|
| Back to top |
|
 |
mcharp General User

Joined: 23 Apr 2005 Posts: 10
|
Posted: Mon Apr 25, 2005 4:39 am Post subject: |
|
|
Thanks again.
Now I have everything I need. |
|
| Back to top |
|
 |
pitonyak Administrator


Joined: 09 Mar 2004 Posts: 3623 Location: Columbus, Ohio, USA
|
Posted: Tue Apr 26, 2005 9:14 am Post subject: |
|
|
| Quote: | | And, we haven't yet some facilities found into some commercial IDEs. |
Yeah, but you should see how the watch window works in the new 2.0 development builds. Pretty awesome! _________________ --
Andrew Pitonyak
http://www.pitonyak.org/oo.php |
|
| Back to top |
|
 |
Danad OOo Advocate

Joined: 22 Feb 2004 Posts: 293 Location: Brasil
|
Posted: Thu Apr 28, 2005 4:13 pm Post subject: |
|
|
| Quote: |
Yeah, but you should see how the watch window works in the new 2.0 development builds.
|
Good news, it seems to be promissing.
Thanks. |
|
| Back to top |
|
 |
|