Replies: 3 comments 1 reply
-
It works fine on my machine. |
Beta Was this translation helpful? Give feedback.
-
Ctrl+Shift+A just fills in the list of parameters of a function into the formula editor. That part still works for me. So what you describe is not what Ctrl+Shift+A does - you are talking about the IntelliSense pop-up that displays argument information. You can add this support to your add-in by installing the "ExcelDna"IntelliSense" NuGet package, then adding some code to your project: using ExcelDna.Integration;
using ExcelDna.IntelliSense;
public class AddIn : IExcelAddIn
{
public void AutoOpen()
{
// Versions before v1.1.0 required only a call to Register() in the AutoOpen().
// The name was changed (and made obsolete) to highlight the pair of function calls now required.
IntelliSenseServer.Install();
}
public void AutoClose()
{
IntelliSenseServer.Uninstall();
}
} Then for a function like this [Description("is a useful function that calculates something.")]
public static object DoCalc([Description("is the first value")] double val1,
[Description("is the other value")] double val2)
=> val1 + val2; you get |
Beta Was this translation helpful? Give feedback.
-
Thanks Govert. Even this doesn’t happen for me right now for UDFs:
<https://user-images.githubusercontent.com/414659/228819537-f672416c-1e0e-4427-acdc-b50c5d3933f6.gif>
I will add the Intellisense package as you suggest.
One additional question, my code (which as I mentioned is many years old now) used ExcelDna.Contrib in order to use the ExcelRange class. I think at some point this was moved to ExcelDna proper, but when I updated my packages just now it seems this class is no longer part of ExcelDna.Integration? Here’s the code that’s getting tripped up:
[ExcelCommand(MenuName = "&Zeus", MenuText = "&Tidy Array", ShortCut = "^+T", Name = "TidyArray")]
public static void TidyArray()
{
ExcelRange selection = new ExcelRange(XlCall.Excel(XlCall.xlfSelection, new object[0]) as ExcelReference);
if (selection.HasFormula)
{
string formula = selection.Formula;
//string newFormula = Regex.Replace(formula, "([A-Z]{1,2}[0-9]+)", "!$1");
string newFormula = Regex.Replace(formula, @"(\${0,1}[A-Z]{1,2}\${0,1}[0-9]+)", "!$1");
newFormula = Regex.Replace(newFormula, "!!", "!");
object value = XlCall.Excel(XlCall.xlfEvaluate, newFormula);
if (value is ExcelDna.Integration.ExcelError || value is ExcelDna.Integration.ExcelReference ||
(value.GetType().IsArray && ((object[,])value)[0, 0] is ExcelDna.Integration.ExcelError))
value = XlCall.Excel(XlCall.xlfEvaluate, formula);
if (value is object[,])
{
object[,] values = value as object[,];
int nRows = values.GetLength(0), nCols = values.GetLength(1);
ExcelReference newRef = new ExcelReference(selection.AsRef.RowFirst, selection.AsRef.RowFirst + nRows - 1,
selection.AsRef.ColumnFirst, selection.AsRef.ColumnFirst + nCols - 1);
XlCall.Excel(XlCall.xlcSelect, newRef);
}
}
}
Obviously now Excel has its own auto-expand functionality for array functions so this isn’t strictly required for me, but I’d like to get it back into working shape if possible!
As ever, thank you!
From: Govert van Drimmelen ***@***.***>
Sent: Thursday, March 30, 2023 4:29 PM
To: Excel-DNA/ExcelDna ***@***.***>
Cc: Uzair ***@***.***>; Author ***@***.***>
Subject: Re: [Excel-DNA/ExcelDna] Can't show argument list with Ctrl+Shift+A (Discussion #585)
Ctrl+Shift+A just fills in the list of parameters of a function into the formula editor. That part still works for me.
<https://user-images.githubusercontent.com/414659/228819537-f672416c-1e0e-4427-acdc-b50c5d3933f6.gif>
So what you describe is not what Ctrl+Shift+A does - you are talking about the IntelliSense pop-up that displays argument information.
Excel does not show IntelliSense for UDF functions, but I have made a custom add-in that adds this feature - see https://github.com/Excel-DNA/IntelliSense/
You can add this support to your add-in by installing the "ExcelDna"IntelliSense" NuGet package, then adding some code to your project:
using ExcelDna.Integration;
using ExcelDna.IntelliSense;
public class AddIn : IExcelAddIn
{
public void AutoOpen()
{
// Versions before v1.1.0 required only a call to Register() in the AutoOpen().
// The name was changed (and made obsolete) to highlight the pair of function calls now required.
IntelliSenseServer.Install();
}
public void AutoClose()
{
IntelliSenseServer.Uninstall();
}
}
Then for a function like this
[Description("is a useful function that calculates something.")]
public static object DoCalc([Description("is the first value")] double val1,
[Description("is the other value")] double val2)
=> val1 + val2;
you get
<https://user-images.githubusercontent.com/414659/228821939-32b588cd-7ba0-4266-a3d5-47a9a9d55cd8.gif>
—
Reply to this email directly, view it on GitHub <#585 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AD2TARZZQ2PP7BBKRADMXBDW6VU6LANCNFSM6AAAAAAWMLLDRM> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/AD2TAR4QGHDB3OZIOCIJB5LW6VU6LA5CNFSM6AAAAAAWMLLDROWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAKOIQG.gif> Message ID: ***@***.*** ***@***.***> >
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I have this method that would show arguments list with Ctrl+Shift+A:
[ExcelFunction(Category = "ZeusXL_RTD", Description = "Returns a Contract's current market by RTD")]
public static object GetMarket(string Contract, string TickType) {}
I can see the arguments list + the description in the Function Wizard but the keyboard shortcut (Ctrl+Shift+A) no longer works.
I've been away from this addin + Exceldna for a long time, so not sure if something has changed or if this is an Excel problem?
Thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions