The following steps may achieve your request.
step 1. Register an onSingleClicked event handler on your worksheet in your Custom Functions add-in.
async function registerClickHandler() {
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getActiveWorksheet();
sheet.onSingleClicked.add((event) => {
return Excel.run((context) => {
console.log(`Click detected at ${event.address}`);
return context.sync();
});
});
console.log("The worksheet click handler is registered.");
await context.sync();
});
}
step 2. Use Excel.Range.formulas property to get the function name when the event is detected.
const cell = sheet.getCell(row, col);
cell.load("formulas");
await context.sync();
console.log(`Cell.formula is "${cell.formulas}"`);
step 3. jump to the corresponding help page(prepared by yourself) URL in your add-in's task pane.
Another way is to provide an overall help page link in your add-in's task pane to let the user learn how to use your Custom Functions directly when they click the link, instead of when they click the formula. I'll suggest this way.
Moreover, currently, the Custom Functions doesn't support showing the dialog. If you are requesting this feature, I'd recommend going to Microsoft 365 Developer Platform, see if this feature has already been requested, or request a new feature.