My specific problem right now is “How do I write a macro to apply a name to cell?”
But the thing I really want help with is how to work out the answer to questions like these from the documentation for myself.
Of course, the first thing I did was to “record macro” whilst performing the action. That doesn’t give me working code but it does at least give me a rem which suggests that “.uno:AddName” might be a clue, so I guess at some code:
fnDispatch("GoToCell", array("ToPoint", "A1") fnDispatch("AddName", array("AddName", "foo"))
That doesn’t work, so my next stop is Google. I Google various things like:
- LibreOffice calc macro AddName
- OpenOffice calc macro AddName
- AddName UNO
But without turning up anything useful.
Next I go to http://api.libreoffice.org/docs/common/ref/com/sun/star/table/module-ix.html and do some trawling. I find things like getCellRangeByName() which can use named ranges but I fail to find anything to set the range.
So, whilst an answer about how to create a named range would be very useful, what I really want to know is how could I find the functionality in the documentation for myself?
Many thanks
Andrew