Excel 2016 ExcelAsyncHandle crash #564
Replies: 12 comments 3 replies
-
Hi @aytactaner - can you please confirm whether this is a problem with the latest Excel-DNA v1.6.1-beta3? |
Beta Was this translation helpful? Give feedback.
-
Hi Govert, |
Beta Was this translation helpful? Give feedback.
-
@aytactaner I've had a look at your project, but not had a chance to check under Excel 2016. But I see you are returning a 1x1 array from the native async function. I wonder if the problem you have might relate to the fact that Excel 365 has 'dynamic arrays' support and the Excel 2016 does not. Could you perhaps test with a function that only returns a value directly, not in an array? |
Beta Was this translation helpful? Give feedback.
-
And does it only crash when you create or save the file with new Excel and then open with old Excel? Or, does the function always crash with old Excel, even when you create a new file. |
Beta Was this translation helpful? Give feedback.
-
Even I create new file in Excel 2016 or 2019 it crashes. But I realized something new. Only crashes if one of cells refereces to another cell which returns array (both of are native async). If I remove that dependency I works without any problem. |
Beta Was this translation helpful? Give feedback.
-
Also, if I ExcelAsyncHandle.SetResult immediately instead of Task.Run it works. |
Beta Was this translation helpful? Give feedback.
-
OK - I got VM with Excel 2016 running. It feels like native async can't handle arrays before Excel 365.
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
You say
But earlier you said
Can you clarify? I suspect this is an Excel bug, where the combination of native async UDF and array results are crashing Excel 2016. If this is an Excel bug, you could check the version of Excel in the function and only return an array if the version supports Dynamic Arrays. public static class UtilityFunctions
{
static bool? _supportsDynamicArrays;
[ExcelFunction(IsHidden = true)]
public static bool dnaSupportsDynamicArrays()
{
if (!_supportsDynamicArrays.HasValue)
{
try
{
var result = XlCall.Excel(614, new object[] { 1 }, new object[] { true });
_supportsDynamicArrays = true;
}
catch
{
_supportsDynamicArrays = false;
}
}
return _supportsDynamicArrays.Value;
}
} |
Beta Was this translation helpful? Give feedback.
-
I mean I can write new scalar formulas, not arrays in 2016. If I make them as array using Control+Shift+Enter and it referenced from another cell Excel crashes. I have about 2.5k functions and a few of them are have to return array. I don't think dynamic array support checking can be a workaround because it crashes even if I do not return nothing. Following function also crashes if referenced from another cell. Because Excel expects array from that function.
|
Beta Was this translation helpful? Give feedback.
-
OK - I can confirm that I can get 64-bit Excel 2016 version 2104 to crash too, using the combination of native async array function calls.
It might be worth pressing the Feedback -> Send a Frown button to report the problem. The next step would be to reproduce this with a native code .xll add-in. If this has the same bahaviour, we know that it is an Excel bug and not related to Excel-DNA. I'm not sure when I'll get a chance. Then, if this is an Excel bug, it would seem very unlikely that they would fix it, unless you are a very important account for them. Do you have any direct support channel to Microsoft through an account manager? |
Beta Was this translation helpful? Give feedback.
-
Hi,
The document which is created in Office365 is crashing Excel application while opening in Excel 2016 (Microsoft® Excel® 2016 MSO (Version 2301 Build 16.0.16026.20002) 32-bit ) version. Please find attached the document and add-in project. Do you have any idea ?
Thank you.
document.xlsx
Project.zip
Beta Was this translation helpful? Give feedback.
All reactions