none
Problem with VSTO4 Based AddIn: debugging not working, UDF not working RRS feed

  • Question

  • I was developing a AddIn a month ago using Windows 7/Visual Studio 2010/Office 2010/VSTO4. I Have Ribbon Toolbar with Custom UI and UDF function definition in this plugin.  Everything works fine when I create a TESTSUM function with function definition as :

    public double TESTSUM(Excel.Range r) 
    { ... }

    It does the calculation on Sheet as I wrote. However for some reason I had to stop development for few weeks and later when I restart on project, I got following problem.

    1. At First UDFs doesn't load, however Ribbon does load. I have single Complied Assembly that contain both UDF and Ribbon information. However after struggling I try to change the version to increment it to make it working again. Before I have Version set as 2.0.0.*, but I need to change it to 2.0.1.* not sure why this happens? Any idea.

    2. Now I try to add a String PArameter to above function definition like 

    public double TESTSUM(string type, Excel.Range r) 
    {
    ...
    }

    But since that it stop doing calculation and start throwing #VALUE error. I try to revert to old definition of function but still getting the same #VALUE error. Any idea what is going wrong ?


    Sumit Gupta http://www.sumitgupta.net

    Friday, March 30, 2012 10:16 AM

Answers

All replies

  • Oh, I forgot to add third problem

    3. in attempt to debug the function, I put the Breakpoint on First line of my function but that breakpoint never get hit even when I use F5 to load Plugin and get it running.


    Sumit Gupta http://www.sumitgupta.net

    Friday, March 30, 2012 10:18 AM
  • Hi Vikasumit,

    Thanks for posting in the MSDN Forum.

    As far as I know. The UDF will not include in Add-in project. I would recommend you create a ClassLibrary project to create your UDF.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, April 3, 2012 8:54 AM
    Moderator
  • Well Tom,

    I got the UDF working from within Class library. And as I said, my UDF works from same project on day 1, but on day 2 I have to manually upgrade the Assembly version to get it working again inspite of fact that I have 2.0.0.* assembly versioning enable. However the software is working as expected thus far.

    Thanks for your reply and MSDN belong to us, so no need to thanks on posting here :P.


    Sumit Gupta http://www.sumitgupta.net

    Tuesday, April 3, 2012 10:28 AM
  • Hi Vikasumit,

    Did you follow this blog http://blogs.msdn.com/b/eric_carter/archive/2004/12/01/273127.aspx to create your UDF? I never see the situation like your description. It's very interesting. Let's see whether we can find out why it is.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Vikasumit Thursday, April 5, 2012 9:06 AM
    Thursday, April 5, 2012 7:57 AM
    Moderator
  • Hello Tom,

    Well about that Blog URL, I would say that is bible to VSTO Addin..isn't it. I mean that is starting point for all addin developer like us use to get started :). Indeed I follow it.

    I seems to solve my problem #2, and #3 above. as I realise there was a signature/definiation problem for my function and hence the breakpoint was never hit. But I am still not sure on Assembly version, but since it is working fine now since than I guess I must have corrupted some registry settings in attempt to debug/load/reload and hence a new incremented version is needed on my debug machine. Not sure, but my guess.


    Sumit Gupta http://www.sumitgupta.net

    Thursday, April 5, 2012 9:06 AM