Using Offcie 365 Dynamic Arrays, Excel automatically adds @

467 views
Skip to first unread message

guido debouver

unread,
May 15, 2020, 4:05:39 AM5/15/20
to Excel-DNA

just converted all of my UDF's to use the new dynamic array feature in Office 365 - works great :-)

Just a small problem, Excel always adds the @ sign automatically when adding the formula, reuslting in one cell to be returned.
User had to go and remove teh @ to get the full array

Is tehre a setting in ExcelDNA to avoid this - or am i doing something wrong ( again )

kind regards

guido


Govert van Drimmelen

unread,
May 15, 2020, 4:18:46 AM5/15/20
to exce...@googlegroups.com

Hi Guido,

 

You can read about the implicit intersection @ operator here: https://support.microsoft.com/en-us/office/implicit-intersection-operator-ce3be07b-0101-4450-a24e-c1c999be2b34?ui=en-us&rs=en-us&ad=us

 

The @ gets added to your formula in two cases:

 

I have put a few other links here: https://github.com/Excel-DNA/ExcelDna/wiki/Dynamic-Arrays

 

-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 view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/0b5fa217-b6d2-4af8-8b42-3cc798024e35%40googlegroups.com.

guido debouver

unread,
May 15, 2020, 4:38:08 AM5/15/20
to Excel-DNA

Got it.


In fact, and for the benefit of others with the same problem, I incldued a formula when clicking a button.

The code then called 

ExcelDnaUtil.Application.Activecell.formula = "=whateverfunction()"

ExcelDnaUtil.application.Dialogs(450).Show()


I changed it to ExcelDnaUtil.Application.Activecell.formula2 = "=whateverfunction()" and all works fine


thanks






dd.jpg


Kevin Fox

unread,
Jul 27, 2020, 2:56:08 PM7/27/20
to Excel-DNA
Guido

Did you solve this in C# or VBA? I am having the same issue.

Kevin Fox

unread,
Jul 29, 2020, 1:13:44 PM7/29/20
to Excel-DNA
If anyone else stumbles on this issue for me the fix was changing the way I was inserting the formula from 

activeCell.Formula = $"=SOME_FUNCTION()";

to 

activeCell.FormulaArray = $"=SOME_FUNCTION()";

Govert van Drimmelen

unread,
Jul 29, 2020, 3:26:07 PM7/29/20
to exce...@googlegroups.com

Hi Kevin,

 

Are you

  1. creating formulas in pre-Dynamic Array Excel so that when the sheet is opened in Dynamic Array Excel they will not show with the @-sign, or
  2. are you running in Dynamic Arrays Excel and you want to insert formulas without the @-sign?

 

In the second case, you would use activeCell.Formula2 = "=SOME_FUNCTION()"

 

-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.

guido.d...@pa-ats.com

unread,
Dec 8, 2021, 5:19:35 AM12/8/21
to Excel-DNA
hello all,

I had following vb .NET code to add a formula in a selected cell, which worked fine
ExcelDnaUtil.Application.ActiveCell.formula2 = "=" & formule.ToUpper & "()"

now, I need to recompile as per client instructions with Option Strict = On, and I am having problems.
Dim a1 As Excel.Application = CType(ExcelDnaUtil.Application, Excel.Application)
Dim c1 As Excel.Range = a1.ActiveCell
c1.Value2 = "=" & formula & "()"
            
Now the above code adds again the @ operator into the cell ????
AM I doing something stupid ?

guido.d...@pa-ats.com

unread,
Dec 8, 2021, 5:25:27 AM12/8/21
to Excel-DNA
PLEASE DISREGARD PREVIOUS POSTING - THERE WAS A STUPIDITY IN IT

hello all,

I had following vb .NET code to add a formula in a selected cell, which worked fine
ExcelDnaUtil.Application.ActiveCell.formula2 = "=" & formule.ToUpper & "()"

now, I need to recompile as per client instructions with Option Strict = On, and I am having problems.
Dim a1 As Excel.Application = CType(ExcelDnaUtil.Application, Excel.Application)
Dim c1 As Excel.Range = a1.ActiveCell
c1.formula2 = "=" & formula & "()"
            
The above doesnt work - it doesnt seem formula2 is a member of Microsoft.Office.Interop.Excel.Range

Any ideas ?
thanks

guido.d...@pa-ats.com

unread,
Dec 8, 2021, 10:18:52 AM12/8/21
to Excel-DNA
I have to load rev 16 of the  Microsoft.Office.Interop library, this seems to include the Formula2 field on the Exce.Range.
However, this now invalidates the loading of Office.dll ( Microsoft.Office.core ), which I dont find in rev 16. 
If I reference rev 15 of Office.dll, it conflicts with rev 16 of Microsoft.Office.Interop

Anyone any idea - where can I find rev 16 of Microsoft.Office.core. It sure is not on my PC ( with Office 365 installed )

thanks
guido
Reply all
Reply to author
Forward
0 new messages