Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default XLL Formula Reference

"Matthew Wieder" wrote in message
...
We inherited an xll which provides a formula that can be used in a cell
in Excel. If someone uses that formula on a spredahseet (let's say in
cell F4) and then they recalc, is there some way for us in that xll code
to know that the formula is in cell F4?
thanks!


Hi Matthew,

Here's one way to determine the address of a function's calling cell:

XLOPER xlRef, xlRow, xlCol, xlAddress;
Excel4(xlfCaller, &xlRef, 0);
xlRow.xltype = xltypeNum;
xlRow.val.num = xlRef.val.sref.ref.rwFirst + 1;
xlCol.xltype = xltypeNum;
xlCol.val.num = xlRef.val.sref.ref.colFirst + 1;
Excel4(xlfAddress, &xlAddress, 2, &xlRow, &xlCol);
// xlAddress now contains the calling cell's address

--
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 *


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reference Formula Help Scott Excel Discussion (Misc queries) 2 January 12th 10 03:23 PM
How do I set a formula, that add next cell reference in a Formula Gary Excel Worksheet Functions 2 July 18th 09 12:20 AM
Using an offset formula for the reference in a relative reference Cuda Excel Worksheet Functions 6 November 15th 06 05:12 PM
Look Up Reference Formula JR573PUTT Excel Discussion (Misc queries) 7 March 9th 06 10:14 PM
Is it Possible in a formula to have a formula for cell reference? RogerBarker Excel Worksheet Functions 3 February 16th 05 09:00 PM


All times are GMT +1. The time now is 04:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"