title: OOo/LibreOffice UNO / Java: How to get calling spreadsheet cell of a calc function?
body: <p>In an UNO extension for OpenOffice/LibreOffice Calc (Spreadsheet), written in Java, how can you determine the calling cell inside the implementation of a UDF (spreadsheet function)?</p>
  
  <p><strong>Remarks</strong></p>
  
  <ul>
  <li>In Excel/VBA this is possible via <code>Application.Caller</code></li>
  <li>The main motivation to get the caller is logging/tracing/debugging, i.e., view the calling cell as part of a stack trace.</li>
  <li>It should be possible to obtain this information, since built-in functions like "ROW()" and "COLUMN()" do have some knowledge of the calling cell.</li>
  <li>An application where this possibility is used (for Excel) is <a href="http://www.obba.info" rel="noreferrer">Obba</a>, an object handler for spreadsheets. Here the "control panel" provides a list of (Java) exceptions including the calling cell, <em>i.e.</em>, the cell is part of the stack trace. See the following screenshot:</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/7qzOx.png" alt="Obba Control Panel showing exceptions by spreadsheet cell of calling function"></p>
  
  <p>This is also a feature request on the <a href="https://issues.apache.org/ooo/show_bug.cgi?id=120004" rel="noreferrer">Apache OpenOffice Bugzilla</a></p>