3

Is there is way to access cell that contains my UDF? I need to reset some cache when function with same parameters is run from different cell. Didn't find anything suitable in exceldna utils.

Thanks, Alex

Alex Michel
  • 416
  • 3
  • 13

1 Answers1

4

You can call

ExcelReference caller = XlCall.Excel(XlCall.xlfCaller) as ExcelReference;

The result will be an ExcelReference if you're called from a sheet formula. It might be null if you're called via Application.Run or a few other ways.

ExcelReference is a wrapper for the C API sheet reference.

Govert
  • 16,387
  • 4
  • 60
  • 70