RE: [ExcelDna] Integrating LimeLM licensing code

50 views
Skip to first unread message

Govert van Drimmelen

unread,
Jul 4, 2026, 5:31:08 PMJul 4
to exce...@googlegroups.com

One typical plan is to integrate the licensing into an add-in ribbon.

You would have a static flag or other indicator of the current licensing status, which you could check in every function if you want to disable the functions if the add-in is not licenced. Then you have an Excel-DNA ribbon extension with some UI to indicate the status and support licensing / login operations.

 

The exact dance between the external program and Excel might need a bit more thought. But suppose you have a button on the ribbon that shows a Windows Forms form – that would then work the same way you show.

 

I would suggest against automatically popping up a modal form from your add-in. That is quite hostile to someone running Excel for other reasons, of via automation.

 

-Govert

 

 

From: exce...@googlegroups.com <exce...@googlegroups.com> On Behalf Of gertja...@gmail.com
Sent: 4 July 2026 10:47
To: Excel-DNA <exce...@googlegroups.com>
Subject: [ExcelDna] Integrating LimeLM licensing code

 

Hi everyone,

I'm trying to integrate the LimeLM licensing code in my VB.NET add-in, but their sample code is for a "Windows Form" project, where the code below lives in the "main form".  I'm trying to figure out if and where this code should sit in my Excel-DNA project...  Thanks for any suggestions!

------------------------------------------------------------------

    'This event handler is called when TurboActivate.exe closes.
    Private Sub p_Exited(ByVal sender As Object, ByVal e As EventArgs)

        ' remove the event
        RemoveHandler DirectCast(sender, Process).Exited, New EventHandler(AddressOf p_Exited)

        ' the UI thread is running asynchronous to TurboActivate closing
        ' that's why we can't call TAIsActivated(); directly
        Invoke(New IsActivatedDelegate(AddressOf CheckIfActivated))
    End Sub

    Private Delegate Sub IsActivatedDelegate()

------------------------------------------------------------------

 

--
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 visit https://groups.google.com/d/msgid/exceldna/f11f95cc-7029-483b-aca7-59ef125c1980n%40googlegroups.com.

gertja...@gmail.com

unread,
Jul 9, 2026, 10:19:49 AMJul 9
to Excel-DNA
Thanks for your earlier reply, Govert! Helpful as always.
I seem to have gotten the licensing code integrated properly now, but... only in VB.NET's DEBUG mode. When I try to run the compiled XLL, I get an Excel-DNA dialogue, stating ...
Initialization [Error] DnaLibrary AutoOpen Error : TargetInvocationException - Exception has been thrown by the target of an invocation.
How do I track this problem down?  I'm baffled :-)

Govert van Drimmelen

unread,
Jul 10, 2026, 5:02:38 AMJul 10
to Excel-DNA
That's kind of a general error when your assembly is loaded, so can be tricky to track down. Can be an unhandled exception in your AutoOpen (try to wrap in a try-catch) or an assembly load error at JIT time. Maybe a dependency that is present in your debug output folder, but not release? You can start with a simpler working case and grow to your addin again, seeing where the error creeps in.

-Govert

Govert van Drimmelen

unread,
Jul 10, 2026, 5:05:55 AMJul 10
to Excel-DNA
Ribbon etc is also loaded in the Excel-DNA AutoOpen, so any assembly load error can be triggered then as it loads the assemblies to look for functions.
There is a tool called Fusion (fuslogvw or something) to trace .net assembly loads. Tricky to use but very helpful sometimes.

-Govert

Gert-Jan Fien

unread,
Jul 10, 2026, 8:22:52 AMJul 10
to exce...@googlegroups.com
Thanks, Govert.
Is it possible to get more detail from the system about this "exception"?  Can I switch off that Excel-DNA dialogue that states the generic error in the hope of getting better clues?

Kind regards,
Gert-Jan

From: exce...@googlegroups.com <exce...@googlegroups.com> on behalf of Govert van Drimmelen <govert.va...@gmail.com>
Sent: 10 July 2026 1:05 PM
To: Excel-DNA <exce...@googlegroups.com>
Subject: Re: [ExcelDna] Integrating LimeLM licensing code
 
You received this message because you are subscribed to a topic in the Google Groups "Excel-DNA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/exceldna/0WK0Y52wj1o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to exceldna+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/exceldna/CABCjBXN%3DhKn%3D97KfUMOo1ZOO60my73NM0aMg3ak3BcWq8A43Mg%40mail.gmail.com.

Govert van Drimmelen

unread,
Jul 10, 2026, 8:46:20 AMJul 10
to exce...@googlegroups.com

Hi Gert-Jan,

 

> Is it possible to get more detail from the system about this "exception"? 

Not easily – I think you need to explore the differences between your debug and your release.

 

Or start with a simple add-in that works and add everything back.

That might be fastest way to find the bit that is breaking it.

 

If you’re stuck, let me know if you want me to have a look with you – you can send me an email directly.

 

-Govert

Reply all
Reply to author
Forward
0 new messages