xlfCaller

A

Aaron Queenan

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.
 
R

Rob Bovey

Aaron Queenan said:
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 *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top