title: Possible to tell which workbook called a function in an Excel Add-In (xla)
body: <p>I want to write a little logging function in an excel add-in that I will be calling from many different workbooks.  I'd like to be able to just call it by passing only the log text, and the log function itself could handle the timestamp, <strong>workbookname</strong>, etc.</p>
  
  <p>However, I cannot use either ThisWorkbook or ActiveWorkbook to determine which workbook was responsible for making the call, as Thisworkbook will return a reference to the add-in itself, whereas VBA code running in a workbook other than the workbook with active focus in Excel could make the call, but the ActiveWorkbook will return the one that has focus in the window.</p>
  
  <p>Application.Caller looked like a possible solution, but this seems to work only when the function is called from a cell, not from VBA.</p>
  
  <p>Is what I'm trying to do impossible?</p>
  
  <h2>Update</h2>
  
  <p>According to > 1 person, this is in fact impossible.  If anyone happens to know some clever workaround please speak up.</p>