How to maintain the progId of automation addin in xll UDF.

Add-in Express™ Support Service
That's what is more important than anything else

How to maintain the progId of automation addin in xll UDF.
 
Ashim Mishra




Posts: 51
Joined: 2016-03-01
Hi Team,

We have recently switched our automation UDFs to XLL based UDF. We used to have prog Id as MyCompany.UDF in automation addin. With new XLL implementation we mapped MyCompany.UDF.Add and Add to the same function so that XLL still supports older sheet which was created with automation based addin.



this.adxExcelVADataFunctionDescriptor = new AddinExpress.MSO.ADXExcelFunctionDescriptor(this.components);
            this.adxExcelVADataFunctionDescriptor.Description = "Returns data";
            this.adxExcelVADataFunctionDescriptor.FunctionName = "Add";
            this.adxExcelVADataFunctionDescriptor.IsThreadSafe = false;

            this.adxExcelVADataObsoleteFunctionDescriptor = new AddinExpress.MSO.ADXExcelFunctionDescriptor(this.components);
            this.adxExcelVADataObsoleteFunctionDescriptor.Description = "Returns data";
            this.adxExcelVADataObsoleteFunctionDescriptor.FunctionName = "AddObsolete";
            this.adxExcelVADataObsoleteFunctionDescriptor.IsThreadSafe = false;
            this.adxExcelVADataObsoleteFunctionDescriptor.UnicodeName = "MyCompany.UDF.Add";


This approach is working for us and we are able to pull the values.

The only issue we are getting is the cosmetic issue where our clients are complaining about long formulas like MyCompany.UDF.Add in their sheets instead of only Add formula.

Is there any way in which we can use the same ProgId in xll so that we don't get long formulas name ?
Posted 10 Dec, 2020 08:31:35 Top
Andrei Smolin


Add-in Express team


Posts: 18338
Joined: 2006-05-11
Hello Ashim,

I may not understand something. It looks like you use "MyCompany.UDF.Add" as a replacement for the name your Excel Automation add-in used. If so, it must be the same name. Otherwise, older sheets created with automation based add-in wouldn't be supported. If the name is the same, complaining doesn't make sense - it was your choice made a while back. Do you talk about replacing that name in older sheets?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Dec, 2020 02:16:39 Top
Andrei Smolin


Add-in Express team


Posts: 18338
Joined: 2006-05-11
Ashim Mishra writes:
Is there any way in which we can use the same ProgId in xll so that we don't get long formulas name ?


I don't understand this question. I assume no ProgId is referenced by existing formulas.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 11 Dec, 2020 02:29:46 Top
Ashim Mishra




Posts: 51
Joined: 2016-03-01
Thanks Andrei.

Yes, i am talking about replacing the long formulas to short one. In automation addin you won't see the ProgId in the formulas.

for e.g If your progId is MyCompany.UDF in automation addin and your formula is Add, user will only see the formulas like =Add() in excel sheet.

 [GuidAttribute("6848362A-AEC1-4350-93CA-38CD1D3FFD94"),
    ProgId("MyCompany.UDF"), ClassInterface(ClassInterfaceType.AutoDual)]
    public partial class UDF : AddinExpress.MSO.ADXExcelAddinModule
    {
        private RemotableData objRemotabledata;

    }



But when we switched to XLL based implementation all those old formulas started to appear like = MyCompany.UDF.Add()

One obvious way to fix this is by find and replace "MyCompany.UDF.Add" with "Add", but i am not sure how many users will be ready to do that.

I wanted to know how we can maintain the same using xll.
Something like


    [ComVisible(true)]
[B][ProgId("MyCompany.UDF")][/B]

    public class XLLModule : AddinExpress.MSO.ADXXLLModule
    {
        private Common.RemotableData objRemotabledata;
    }


Do we have ProgId concept in xll so that all our new formulas and old formula appears same.
Posted 11 Dec, 2020 05:05:17 Top
Andrei Smolin


Add-in Express team


Posts: 18338
Joined: 2006-05-11
Hello Ashim,

Ashim Mishra writes:
But when we switched to XLL based implementation all those old formulas started to appear like = MyCompany.UDF.Add()


This cannot be just "started to appear". Obviously, you did something that you think is natural.


Ashim Mishra writes:
Do we have ProgId concept in xll...


No. And you don't do anything for the functions to look the same: as you've rightly noticed, the user will only see the function name - so, you only need to name the functions; nothing else is required. I believe the issue doesn't occur if you create a new XLL add-in and create the function of that name. If it does, send us that new project to the support email address; please make sure it contains a link to this topic.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 14 Dec, 2020 03:20:31 Top
Ashim Mishra




Posts: 51
Joined: 2016-03-01
I understand that i don't have to do anything for the functions in xll. But what i am really asking is a way around in xll so that my formulas built on automation addin will start appearing like formula we have in xll now.

I don't want users to see the long formula prefixed with ProgId.
Posted 15 Dec, 2020 00:46:17 Top
Andrei Smolin


Add-in Express team


Posts: 18338
Joined: 2006-05-11
Hello Ashim,

Ashim Mishra writes:
I don't want users to see the long formula prefixed with ProgId.


I wouldn't want this, too. I don't understand however what you've done for the function names to be prefixed. As you've pointed out: the function name is just a function name. If you see the same issue in a newly-created sample project, send us that project for testing.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 15 Dec, 2020 03:46:19 Top