The quest for the Excel custom function tooltip
Solution 1:
I've posted a proof-of-concept project to GitHub as the Excel-DNA IntelliSense project, implementing this.
Using the UI Automation classes to monitor the appropriate Excel user interface events, a form is displayed when appropriate.
The code is wrapped as an Excel-DNA add-in, and works on my Excel 2013 / Windows 8 machine. I've tested on one other configuration (64-bit Excel 2010 on Windows Server 2008) and had a serious problems.
For a C# function defined with the Excel-DNA attributes like this:
[ExcelFunction(Description =
"A useful test function that adds two numbers, and returns the sum.")]
public static double AddThem(
[ExcelArgument(Name = "Augend",
Description = "is the first number, to which will be added")]
double v1,
[ExcelArgument(Name = "Addend",
Description = "is the second number that will be added")]
double v2)
{
return v1 + v2;
}
we get both the function description
and when selecting the function, we get argument help
That looks nice, but it's all still very flaky, only works on my machine and sometimes crashes Excel. It might be a start, though...
Update 9 May 2014:
I've made some progress figuring out how to make the argument help work under older Excel and Windows versions. However, it still needs quite a lot of work to get everything reliable. Anyone who would like to help with this should please contact me directly.
Update 18 June 2016:
Excel UDF IntelliSense support for both Excel-DNA add-ins and VBA functions is now being tested. See the Getting Started page on GitHub for instructions.
Solution 2:
How about
- Capture inputting text on key press event of cell. like this
- Check if the text matches with custom functions.
- If matches, then show something like label or shape to pretend be a tooltip. like this
Is this acceptable?
It is a little ugly but easier.