Hi Ron,
Yes, that’s right. There are some more detailed usage explanations on GitHub: https://github.com/Excel-DNA/IntelliSense/wiki/Usage-Instructions
To incorporate the ExcelDna.IntelliSense.dll into your library:
1. Install the (currently pre-release) NuGet package ExcelDna.IntelliSense. (In the Package Manager Console: PM> Install-Package ExcelDna.IntelliSense -Pre.)
2. The package adds references to three libraries:
· ExcelDna.IntelliSense.dll
· UIAComWrapper.dll
· Interop.UIAutomationClient
·
3. Register the IntelliSenseServer in your add-in's AutoOpen() implementation:
using ExcelDna.Integration;
using ExcelDna.IntelliSense;
public class AddIn : IExcelAddIn
{
public void AutoOpen()
{
IntelliSenseServer.Register();
}
public void AutoClose()
{
}
}
4. Finally (only needed for the packed add-in):
Add the reference entries in your .dna file, used for packing the extra libraries into the -packed.xll:
<DnaLibrary Name="IntelliTest Add-In" RuntimeVersion="v4.0">
<ExternalLibrary Path="IntelliTest.dll" LoadFromBytes="true" Pack="true" />
<Reference Path="ExcelDna.IntelliSense.dll" Pack="true" />
<Reference Path="UIAComWrapper.dll" Pack="true" />
<Reference Path="Interop.UIAutomationClient.dll" Pack="true" />
</DnaLibrary>
-Govert
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.
Hi Frank,
That’s due to the fact that we don’t have any real formula parsing in place yet.
It’s files as issue #12 on GitHub too. Basically we need a better implementation of this:
// TODO: This needs a proper implementation, considering subformulae
// Works out the current function name and argument position for the given formula prefix.
// E.g. =MyFunc(1,
// should set the functionName to “MyFunc” and the currentArgIndex to 1 (0-based)
// Returns true if there is an open function in the formula
internal static bool TryGetFormulaInfo(string formulaPrefix, out string functionName, out int currentArgIndex)
{
var match = Regex.Match(formulaPrefix, @"^=(?<functionName>[\w|.]*)\(");
if (match.Success)
{
functionName = match.Groups["functionName"].Value;
currentArgIndex = formulaPrefix.Count(c => c == ',');
return true;
}
functionName = null;
currentArgIndex = -1;
return false;
}
-Govert
From: exce...@googlegroups.com [mailto:exce...@googlegroups.com]
On Behalf Of Frank Halbach
Sent: 22 June 2016 15:27
To: Excel-DNA <exce...@googlegroups.com>
Subject: [ExcelDna] Re: Excel UDF IntelliSense for Excel-DNA and VBA
There is an issue with quotation marks. https://github.com/Excel-DNA/IntelliSense/issues/16
--
Hi Ron,
The loader lock warning is expected, and you can ignore it.
(And set the debugger to ignore it in future.)
I’ve made a simple add-in with it, and the IntelliSense seemed to work OK.
You have to have the second version from NuGet (ExcelDna.IntelliSense 0.1.2-beta2) as the first one did not have the extra UIAutomation dependencies.
Two more things to check:
1. It only works if your Excel-DNA add-in is using version 0.32 or 0.33. For earlier Excel-DNA versions it won’t show anything.
2. Check that the function wizard does display the right descriptions.
If it’s not that, I can help to debug some more.
-Govert
--
Hi Ron,
I initially thought I would need some kind of ‘Refresh’ function, but removed it last week when I saw that it wasn’t used.
But your late registration case is exactly where we’d need that.
Yes – please open an issue.
-Govert
From: exce...@googlegroups.com [mailto:exce...@googlegroups.com]
On Behalf Of Ron
Sent: 22 June 2016 16:12
To: Excel-DNA <exce...@googlegroups.com>
Subject: Re: [ExcelDna] Re: Excel UDF IntelliSense for Excel-DNA and VBA
I was using the correct version. Actually, I was misguided by the exceptions and I modified a bit the code before making the debugger ignoring them. Finally, I realized that the issue came from the fact that I register my functions manually using "ExcelIntegration.RegisterMethods". If I do that after the "IntelliSenseServer.Register" then the functions are not taken into account by the display server.
--
To post to this group, send email to exc...@googlegroups.com.
Hi Bogey,
I look forward to your feedback on the IntelliSense once you’ve tried it.
It was quite tricky to put together, so for the next year or so I just hope to see whether people actually find it useful, and ensure that it is as stable as possible, rather than extend it with new functionality.
As a further extension, certainly the enum option would be a good feature to try to add. It would also need some more advanced communication between the add-in and the IntelliSense service. But there’s no fundamental reason why that can’t work.
Adding a general callback mechanism to the cell editing, so that you can extend the IntelliSense to non-function text, should be possible too. Again designing the callback API would be one tricky part.
Maybe you can add these suggestions to the IntelliSense GitHub Issues list, so that we at least gather a list of feature requests?
-Govert
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
From: exce...@googlegroups.com [mailto:exce...@googlegroups.com]
On Behalf Of Gert-Jan Fien
Sent: 5 December 2016 17:29
To: Excel-DNA <exce...@googlegroups.com>
Subject: [ExcelDna] Re: Excel UDF IntelliSense for Excel-DNA and VBA
Hi Govert!
--
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+unsubscribe@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Excel-DNA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/exceldna/znanLfLcNkk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to exceldna+unsubscribe@googlegroups.com.
Are you able to access the index at
https://api.nuget.org/v3/index.json
from a browser?
I can, and get back some json document.
(And the package installation works fine here.)
-Govert
--
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Excel-DNA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/exceldna/znanLfLcNkk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
--
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+unsubscribe@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Excel-DNA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/exceldna/znanLfLcNkk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to exceldna+unsubscribe@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+unsubscribe@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Excel-DNA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/exceldna/znanLfLcNkk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to exceldna+unsubscribe@googlegroups.com.
Public Type VBAArgument Name As String Description As StringEnd Type
Public Type VBAFunction Name As String Description As String args() As VBAArgumentEnd Type
Public Type VBAFunctionCollection funcs() As VBAFunctionEnd Type
Public Function MyVBAFunction(FirstArg, AnotherArg)
MyVBAFunction = FirstArg + AnotherArg
End Function
Function VBAFunctionDescriptions() As VBAFunctionCollection' Describe your functions here using VBAFunction and VBAArgument objects'' Demo:' Dim func1 As VBAFunction' Dim arg1 As VBAArgument' Dim arg2 As VBAArgument'' func1.Name = "MyVBAFunction"' func1.Description = "My custom function with Intellisense"' arg1.Name = "FirstArg"' arg1.Description = "The first argument"' arg2.Name = "AnotherArg"' arg2.Description = "The second argument"'' ReDim func1.args(1 To 2)' func1.args(1) = arg1' func1.args(2) = arg2'' ReDim functions.funcs(1 To 1)' functions.funcs(1) = func1
Dim func1 As VBAFunction Dim arg1 As VBAArgument Dim arg2 As VBAArgument func1.Name = "MyVBAFunction" func1.Description = "My custom function with Intellisense" arg1.Name = "FirstArg" arg1.Description = "The first argument" arg2.Name = "AnotherArg" arg2.Description = "The second argument" ReDim func1.args(1 To 2) func1.args(1) = arg1 func1.args(2) = arg2 ReDim VBAFunctionDescriptions.funcs(1 To 1) VBAFunctionDescriptions.funcs(1) = func1 End Function
Sub EmbedIntelliSense() 'This will store the Macro descriptions in the current workbook 'New descriptions will be available the next time the workbook is loaded. Dim fcol As VBAFunctionCollection Dim func As VBAFunction Dim arg As VBAArgument
fcol = VBAFunctionDescriptions() txt = "<IntelliSense xmlns=""http://schemas.excel-dna.net/intellisense/1.0"">" For iFunc = LBound(fcol.funcs) To UBound(fcol.funcs) func = fcol.funcs(iFunc) txt = txt & "<FunctionInfo><Function Name=""" & func.Name & """ Description=""" & func.Description & """>" For iArg = LBound(func.args) To UBound(func.args) arg = func.args(iArg) txt = txt & "<Argument Name=""" & arg.Name & """ Description=""" & arg.Description & """ />" Next txt = txt & "</Function>" Next txt = txt & "</FunctionInfo></IntelliSense>" 'Remove Existing IntelliSense CustomXML Parts For Each part In ThisWorkbook.CustomXMLParts If part.DocumentElement Is Nothing Then 'Skip ElseIf part.DocumentElement.BaseName = "IntelliSense" Then part.Delete End If Next ThisWorkbook.CustomXMLParts.Add txtEnd Sub
Public Function MyVBAFunction(FirstArg, AnotherArg)':Description: My custom function with Intellisense':Argument FirstArg: The first argument':Argument AnotherArg: The second argument
MyVBAFunction = FirstArg + AnotherArg
End Function
Imports ExcelDna.IntegrationImports ExcelDna.IntelliSense
Public Class AddInImplements IExcelAddIn
Public Sub AutoOpen() Implements IExcelAddIn.AutoOpenIntelliSenseServer.Register()End Sub
Public Sub AutoClose() Implements IExcelAddIn.AutoCloseEnd Sub
End Class
WARNING: You can test the IntelliSense feature, but there are still some problems with the recent (Nov. 2016) Excel 2016 updates - see this issue: https://github.com/Excel-DNA/IntelliSense/issues/42
You download the .xll and open in Excel, either with File->Open or in the add-ins dialog (Atl+t,i).
(You can load it before or after your own add-in is loaded, it should not matter.)
When the ExcelDna.IntelliSense.xll is loaded at the same time as your add-in, it should show the intellisense info for your add-in.
It is more convenient than using the NuGet package if you want to easily enable or disable the IntelliSense, which might be the case if you’re running Excel 2016, because of the bug introduced by Microsoft’s November 2016 update to Excel 2016.
-Govert