Thread: xlfCaller
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.interopoledde,microsoft.public.excel.programming,microsoft.public.excel.sdk
Rob Bovey Rob Bovey is offline
external usenet poster
 
Posts: 811
Default xlfCaller

"Aaron Queenan" wrote in message
...
If I use Caller() in VBA code, I get a reference to the cell which

includes
the worksheet and workbook, but if I use xlfCaller, it only appears to

give
me the cell. How can I get the other required information?


Hi Aaron,

The xlSheetNm function can be used to return the name of the workbook
and worksheet corresponding to a reference returned by xlfCaller. Usage
looks something like this:

XLOPER xlRef, xlSheetName;
Excel4(xlfCaller, &xlRef, 0);
Excel4(xlSheetNm, &xlSheetName, 1, &xlRef);
// Do something here.
Excel4(xlFree, 0, 1, &xlSheetName);

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *