[Solved] Cell address in A1 format

Creating a macro - Writing a Script - Using the API

[Solved] Cell address in A1 format

Postby skp49 » Thu Jul 20, 2017 7:43 pm

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
skp49
 
Posts: 2
Joined: Thu Jul 20, 2017 7:17 pm

Re: Cell address in A1 format

Postby FJCC » Thu Jul 20, 2017 8:49 pm

If the current selection is a cell and not something else, like a shape, you can get the address with
Code: Select all   Expand viewCollapse view
  oCurrentSelection = ThisComponent.getCurrentSelection()
  sAbsoluteName = oCurrentSelection.AbsoluteName
AOO 3.4 or 4.1 on MS Windows XP ( before 2013-08-03) or Windows 7
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 6152
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Cell address in A1 format

Postby skp49 » Thu Jul 20, 2017 10:43 pm

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
skp49
 
Posts: 2
Joined: Thu Jul 20, 2017 7:17 pm

Re: Cell address in A1 format

Postby RoryOF » Thu Jul 20, 2017 10:51 pm

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.4 on Xubuntu 16.04.03 (mostly 64 bit version) and infrequently on Win2K/XP
14 October 2016 was Pooh's 90th birthday
User avatar
RoryOF
Moderator
 
Posts: 25485
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Cell address in A1 format

Postby FJCC » Thu Jul 20, 2017 11:06 pm

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.
AOO 3.4 or 4.1 on MS Windows XP ( before 2013-08-03) or Windows 7
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 6152
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 9 guests