[Solved] Cell address in A1 format

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
skp49
Posts: 2
Joined: Thu Jul 20, 2017 7:17 pm

[Solved] Cell address in A1 format

Post by skp49 »

Hi:

I am new to OO Basic and Calc, so forgive me if I ask a very simple question.

What I would like to know is if there is a Method or Property that will give me the address of the current Cell in A1 format. Nothing in the Documentation that I have seen seems to mention any such facility.

Thanks for any help you can afford me.

Regards,
skp49
Last edited by Hagar Delest on Mon Jul 24, 2017 2:40 pm, edited 1 time in total.
Reason: tagged solved.
Open Office 4.1.3 on Windows 7 Professional 64 bit
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Cell address in A1 format

Post by FJCC »

If the current selection is a cell and not something else, like a shape, you can get the address with

Code: Select all

  oCurrentSelection = ThisComponent.getCurrentSelection()
  sAbsoluteName = oCurrentSelection.AbsoluteName
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.
skp49
Posts: 2
Joined: Thu Jul 20, 2017 7:17 pm

Re: Cell address in A1 format

Post by skp49 »

Thank you very much.

Any chance of getting a reference to the documentation that contains stuff like that?

Regards,
skp49
Open Office 4.1.3 on Windows 7 Professional 64 bit
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Cell address in A1 format

Post by RoryOF »

All the OpenOffice API documentation is linked off
http://www.openoffice.org/api/

However, it may be sufficient to browse the OpenOffice BASIC documentation, then with a knowledge of BASIC, do some careful searching for existing code.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Cell address in A1 format

Post by FJCC »

The best way to see the properties and methods available in an object is to use an object inspection tool like MRI. There is some information about MRI in this thread.
The code I posted was recorded with MRI.
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.
Post Reply