ExcelDNA publication issue

31 views
Skip to first unread message

Никита Лашин

unread,
May 5, 2022, 2:52:24 AMMay 5
to Excel-DNA
Hello!
I'm sorry, if my question will be inappropriate, but could you please give me some help?
I use ExcelDNA library in my VSTO project and it work perfectly! UDF in my module using some code from VSTO classes (COM addin), like Sub's and Functions in my Ribbon and other classes. On my computer its fine, but i exhausted to find way to publish my project and make it work on other computers. When i use my UDF combining witch my COM addin on other machine i have #VALUE. Of course I understand that my build package is incomplete somewhere. But I don't really understand where. 

In my .dna file i have such text:  
<ExternalLibrary Path="*MY_COM_ADDIN*.dll" ExplicitExports="false" LoadFromBytes="true" Pack="true" IncludePdb="false" />
Is it not enough? If you could give me maybe some list of actions that I could try, I would be very grateful.

Thank you for your time!

Sergey Zhilyakov

unread,
May 5, 2022, 3:46:37 AMMay 5
to exce...@googlegroups.com
Hi,

If you could give me maybe some list of actions that I could try, I would be very grateful.

The list of actions could include this:
  • Check whether all external references are present on the target machine. For VSTO you probably need interop assemblies.
  • Check the Event Log if there are any errors related.
  • Check the Trust Center Settings of Excel on the target machine, in particular on tab Excel Options -> Trust Center -> Trust Center Settings -> Add-ins.
  • Check whether your COM add-in is not disabled by Excel (Excel Options -> Add-ins -> Disabled items -> GO).
  • Check whether your xll is not blocked by Windows (right-click -> Properties -> Unblock).

Best regards,
Sergey


--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/254f070e-c55f-4a90-ad4f-f9a0f64f538an%40googlegroups.com.

Никита Лашин

unread,
May 5, 2022, 5:43:58 AMMay 5
to Excel-DNA
Hi, thank you for your answer! 

Maybe you could give me an advise is there standard way to pack into xll all external references.
Because if, for example, I make test function x (y,z), where x=y+z (without using any library or class from my COM addin) - its ok on external machine. Thats is seems like my general function didn't receive some references. Maybe I just don't know some simple way to pack everything I need into an xll.

Thanks!

Sergey Zhilyakov

unread,
May 5, 2022, 6:44:00 AMMay 5
to exce...@googlegroups.com
Hi,

Because if, for example, I make test function x (y,z), where x=y+z (without using any library or class from my COM addin) - its ok on external machine. Thats is seems like my general function didn't receive some references. 

Did you try to catch the exception in this case? If your function returns #VALUE! then apparently Excel-Dna makes it for you. Try to catch it yourself to see what is going on here.

[ExcelFunction]

public static object Test()

{

try

       {

              //... Do stuff

}

       catch (Exception ex)

       {

              return ex.ToString();

}

}

Maybe you could give me an advise is there standard way to pack into xll all external references.

For your COM add-in check whether all interop assemblies are embedded.

image.png

Also check whether all of your external dependencies are copied to the output directory. Then rebuild the solution and examine the output directory to see all the references that have to be packed explicitly.

image.png

Finally, if you use some 3rd party components installed into GAC, you need to install them manually on the target machine (or build the installer with prerequisites.).

Best regards,
Sergey

Reply all
Reply to author
Forward
0 new messages