Home

Dynamic-aware Excel incorrectly flagging our custom XLL functions as being array functions?

%3CLINGO-SUB%20id%3D%22lingo-sub-291362%22%20slang%3D%22en-US%22%3EDynamic-aware%20Excel%20incorrectly%20flagging%20our%20custom%20XLL%20functions%20as%20being%20array%20functions%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-291362%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20been%20having%20a%20major%20problem%20over%20the%20past%20few%20days%20with%20the%20insider%20build%20of%20Excel%20that%20has%20the%20new%20dynamic%20array%20features%20enabled.%20Some%20of%20my%20Excel%20spreadsheets%20have%20become%20completely%20unusable%20and%20I%20had%20to%20redo%20a%20lot%20of%20them%26nbsp%3B(problem%20started%20slowly%20and%20work%20was%20done%20in%20the%20files%20before%20we%20noticed%20the%20problem).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EExcel%20seems%20to%20have%20marked%20formulas%20using%20our%20custom%20XLL%20functions%20as%20legacy%20CSE%20array%20functions%2C%20even%20though%20these%20functions%20only%20return%20single%20values.%20This%20problem%20has%20cascaded%20into%20other%20issues%20such%20as%20cells%20showing%20%7B%20%3D%23VALUE%23%20%7D%2C%20and%26nbsp%3Bcells%20not%20disconnecting%20from%20the%20RTD%20server.%20As%20per%20the%20following%20link%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Fdynamic-array-formulas-in-non-dynamic-aware-excel-696e164e-306b-4282-ae9d-aa88f5502fa2%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Fdynamic-array-formulas-in-non-dynamic-aware-excel-696e164e-306b-4282-ae9d-aa88f5502fa2%3C%2FA%3E%20%2C%20%22Excel%26nbsp%3B%3CSPAN%3Edetermines%20if%20that%20formula%20has%20the%20potential%20to%20return%20an%20array.%20If%20it%20could%20return%20an%20array%2C%20we%20will%20save%20it%20as%20a%20dynamic%20array%22.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3ECan%20anyone%20from%20Microsoft%20clarify%20exactly%20how%20Excel%20knows%20the%20function%20can%20return%20an%20array%3F%26nbsp%3BOur%20custom%20XLL%20functions%20are%20built%20using%20ExcelDNA%20and%20they%20all%20rely%20on%20a%20RTD%20server%20for%20background%20processing%3B%20the%20return%20type%20is%20'object'%20so%20maybe%20it%20has%20something%20to%20do%20with%20the%20problem...%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-291362%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-650113%22%20slang%3D%22en-US%22%3ERe%3A%20Dynamic-aware%20Excel%20incorrectly%20flagging%20our%20custom%20XLL%20functions%20as%20being%20array%20functions%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-650113%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%20we%20have%20the%20same%20problem%20that%20even%20functions%20that%20return%20only%20one%20string%20are%20considered%20to%20be%20potential%20array%20functions.%20This%20is%20true%20for%20XLL%20functions%20and%20for%20easy%20VBA%20functions%20....%3C%2FP%3E%3CP%3EA%20simple%20function%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPublic%20Function%20SayHello%20()%20As%20String%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20SayHello%20%3D%20%22Hello%22%3CBR%20%2F%3EEnd%20Function%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewill%20be%20added%20in%20the%20new%20Excel%20version%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3D%20%40%20SayHello%20()%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eand%20if%20you%20then%20enter%20the%20formula%20without%20%40%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3D%20SayHello%20()%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewill%20be%20in%20the%20old%20Excel%20version%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%7B%3D%20SayHello%20()%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E...%3F%3C%2FP%3E%3CP%3ESo%20if%20the%20functions%20can%20not%20return%20an%20array%20or%20object%20(Variant)%2C%20then%20the%20behavior%20is%20not%20understandable%20in%20that%20though%20the%20UDF%20can%20only%20return%20a%20single%20object%20....%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-650295%22%20slang%3D%22en-US%22%3ERe%3A%20Dynamic-aware%20Excel%20incorrectly%20flagging%20our%20custom%20XLL%20functions%20as%20being%20array%20functions%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-650295%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F349427%22%20target%3D%22_blank%22%3E%40HaTom%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECould%20you%20clarify%20where%20the%20problems%20are%20occurring%3F%26nbsp%3B%3C%2FP%3E%3CP%3EAre%20old%20workbooks%20failing%20to%20calculate%20in%20the%20DA%20versions%20of%20Excel%20or%20is%20it%20when%20you%20complete%20a%20round%20trip%20and%20try%20to%20get%20a%20modified%20workbook%20back%20into%20the%20production%20versions%20of%20Excel%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20are%20certainly%20occasions%20when%20I%20have%20seen%20'%40's%20sprinkled%20around%20like%20confetti%20but%20I%20think%20the%20workbook%20still%20calculates.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-693896%22%20slang%3D%22en-US%22%3ERe%3A%20Dynamic-aware%20Excel%20incorrectly%20flagging%20our%20custom%20XLL%20functions%20as%20being%20array%20functions%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-693896%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20GabrielMichaud%2C%3CBR%20%2F%3E%3CBR%20%2F%3EAs%20UDF's%20are%20able%20to%20return%20arrays%20or%20ranges%2C%20Excel%20must%20save%20it%20as%20a%20CSE%20array%20for%20Pre-DA%20Excel%20to%20ensure%20it%20calculates%20the%20same%20way.%20The%20only%20exception%20is%20where%20it%20is%20consumed%20by%20a%20function%20that%20expects%20arrays%20or%20it%20is%20implicitly%20intersected%20using%20%40.%20So%20for%20instance%2C%20you%20can%20enter%20%3DSUM(MYUDF())%20or%20%3D%40MyUDF()%20in%20DA%20Excel%20and%20it%20will%20not%20be%20array%20entered%20in%20Pre-DA%20Excel.%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20a%20full%20list%20of%20functions%20that%20can%20return%20an%20array%20visit%20this%20page%3A%20%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Fexcel-functions-that-return-ranges-or-arrays-7d1970e2-cbaa-4279-b59c-b9dd3900fc69%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Fexcel-functions-that-return-ranges-or-arrays-7d1970e2-cbaa-4279-b59c-b9dd3900fc69%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EWe%20recently%20fixed%20the%20RTD%20array%20disconnect%20issue%20and%20have%20released%20it%20to%20insiders%20for%20testing.%20Please%20let%20me%20know%20if%20it%20has%20addressed%20the%20disconnect%20issues.%3CBR%20%2F%3E%3CBR%20%2F%3ERegards%2C%20Joe%3C%2FP%3E%0A%3CP%3EExcel%20Program%20Manager%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-694677%22%20slang%3D%22en-US%22%3ERe%3A%20Dynamic-aware%20Excel%20incorrectly%20flagging%20our%20custom%20XLL%20functions%20as%20being%20array%20functions%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-694677%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9664%22%20target%3D%22_blank%22%3E%40Joe%20McDaid%3C%2FA%3E%26nbsp%3Bthank%20you%20very%20much%20for%20the%20follow%20up!%20I%20am%20glad%20to%20hear%20that%20the%20RTD%20array%20disconnect%20issue%20has%20been%20fixed%2C%20and%20it's%20now%20100%25%20clear%20to%20me%20why%20Excel%20is%20behaving%20this%20way.%20It%20did%20not%20appear%20to%20be%20consistently%20converting%20existing%20formulas%20to%20CSE%20formulas%20when%20I%20first%20started%20playing%20with%20this%20feature%2C%20is%20this%20something%20that%20has%20been%20improved%20or%20can%20you%20share%20the%20circumstances%20when%20it's%20supposed%20to%20happen%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELastly%20-%20are%20you%20considering%20adding%20any%20ability%20to%20flag%20the%20custom%20function%20itself%20as%20not%20being%20an%20array%20function%2C%20so%20that%20we%20wouldn't%20need%20to%20prefix%20it%20with%20%40%20to%20avoid%20it%20being%20saved%20as%20a%20CSe%20array%20functino%3F%20My%20only%20concern%20at%20this%20point%20with%20this%20is%20that%20files%20can%20be%20shared%20with%20users%20of%20older%20versions%20of%20Excel%20which%20will%20still%20have%20the%20RTD%20array%20disconnect%20issue.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
GabrielMichaud
New Contributor

Hi,

 

I've been having a major problem over the past few days with the insider build of Excel that has the new dynamic array features enabled. Some of my Excel spreadsheets have become completely unusable and I had to redo a lot of them (problem started slowly and work was done in the files before we noticed the problem).

 

Excel seems to have marked formulas using our custom XLL functions as legacy CSE array functions, even though these functions only return single values. This problem has cascaded into other issues such as cells showing { =#VALUE# }, and cells not disconnecting from the RTD server. As per the following link https://support.office.com/en-us/article/dynamic-array-formulas-in-non-dynamic-aware-excel-696e164e-... , "Excel determines if that formula has the potential to return an array. If it could return an array, we will save it as a dynamic array".

 

Can anyone from Microsoft clarify exactly how Excel knows the function can return an array? Our custom XLL functions are built using ExcelDNA and they all rely on a RTD server for background processing; the return type is 'object' so maybe it has something to do with the problem...

4 Replies

Hello, we have the same problem that even functions that return only one string are considered to be potential array functions. This is true for XLL functions and for easy VBA functions ....

A simple function

 

Public Function SayHello () As String
     SayHello = "Hello"
End Function

 

will be added in the new Excel version

 

= @ SayHello ()

 

and if you then enter the formula without @

 

= SayHello ()

 

will be in the old Excel version

 

{= SayHello ()}

 

...?

So if the functions can not return an array or object (Variant), then the behavior is not understandable in that though the UDF can only return a single object ....

@HaTom 

Could you clarify where the problems are occurring? 

Are old workbooks failing to calculate in the DA versions of Excel or is it when you complete a round trip and try to get a modified workbook back into the production versions of Excel?

 

There are certainly occasions when I have seen '@'s sprinkled around like confetti but I think the workbook still calculates.

Hi GabrielMichaud,

As UDF's are able to return arrays or ranges, Excel must save it as a CSE array for Pre-DA Excel to ensure it calculates the same way. The only exception is where it is consumed by a function that expects arrays or it is implicitly intersected using @. So for instance, you can enter =SUM(MYUDF()) or =@MyUDF() in DA Excel and it will not be array entered in Pre-DA Excel.

For a full list of functions that can return an array visit this page: https://support.office.com/en-us/article/excel-functions-that-return-ranges-or-arrays-7d1970e2-cbaa-...

We recently fixed the RTD array disconnect issue and have released it to insiders for testing. Please let me know if it has addressed the disconnect issues.

Regards, Joe

Excel Program Manager

@Joe McDaid thank you very much for the follow up! I am glad to hear that the RTD array disconnect issue has been fixed, and it's now 100% clear to me why Excel is behaving this way. It did not appear to be consistently converting existing formulas to CSE formulas when I first started playing with this feature, is this something that has been improved or can you share the circumstances when it's supposed to happen?

 

Lastly - are you considering adding any ability to flag the custom function itself as not being an array function, so that we wouldn't need to prefix it with @ to avoid it being saved as a CSe array functino? My only concern at this point with this is that files can be shared with users of older versions of Excel which will still have the RTD array disconnect issue.