ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   xlfCaller (https://www.excelbanter.com/excel-programming/271020-xlfcaller.html)

Aaron Queenan

xlfCaller
 
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?

Thanks,
Aaron Queenan.



Rob Bovey

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 *




All times are GMT +1. The time now is 01:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com