Home > Mobile >  New functions added to external DLL do not work with ExcelDNA
New functions added to external DLL do not work with ExcelDNA

Time:04-01

I am trying to work out why, having returned to my ExcelDNA project that references my separate C# DLL for communication with a remote ActivePivot, when I add new functions to the DLL they merely return #VALUE! and cannot seem to find any more information.

If I isolate the ExcelDNA part, and use methods from there, it all works. If I, in my new ExcelDNA function, call an existing function in the separate DLL it works however if I add a new function it fails. I just tried adding a very trivial function in the DLL (return 1 1) and it fails.

Has anyone else seen this sort of VisualStudio behaviour? The ExcelDNA and DLL were built in an older Visual Studio and this 'feels' like some sort of IDE / build weirdness! :S

I don't think it's ExcelDNA really although I've added that tag in case it's been seen by that community.

I'm going to try copy/pasting my code to a fresh DLL and build that.

Thanks

Leigh

Here follows two new simple methods that fail (Test() and QueryA(..)), and beginning of huge cube query (Query(....)) one that works. If the working query method is copied and given a new name this also fails.

public static Int32 Test()
{
    return 1   1;
}

//Called by users of this DLL E.g. ExcelDNA xll, Unity etc.
public static Object QueryA(String connectionString,
                            String cube)
{
    return "LATEST";
}

    //Called by users of this DLL E.g. ExcelDNA xll, Unity etc.
    public static Object Query(String connectionString,
                            String cube,
                            String date,
                            String epoch,
                            Object[] dimensions, Object[,] dimensionFilters,
                            Object[] measures, Object[,] measureFilters,
                            Object[] whereItems, Object[,] whereFilters,
                            String orderBy,
                            Boolean repeatValues,
                            Boolean totals,
                            Boolean debug)
{

CodePudding user response:

Thanks for reading and thanks Bradley for the comment.

It seems the Visual Studio project was corrupt, as I created a brand new project, copy/pasted the code into new classes and with the latest ExcelDNA Nuget packages and now I see expected behaviour from both ExcelDNA and my other DLLs.

  • Related