Question

I converted dll (of a VB.NET project) to xll using ExcelDna.Does the xll carry the assembly version in it? If not..How can I version a .xll file? Once I do this, I have to get the assembly version programatically in VBA code..Would appreciate help!

Was it helpful?

Solution

If you just want the version information for your .dll, your code could do something like

Dim myAssemblyName As AssemblyName = _
    new AssemblyName(Assembly.GetExecutingAssembly().FullName)
Dim myVersion As Version = myAssemblyName.Version

To access this from VBA, you could make a hidden UDF in your add-in that you call from VBA using Application.Run.

The .xll has it's own version information and is not automatically updated from the .dll that you embed. You can use the 'verpatch' Version Resource Tool to update the version information of the .xll, as was discussed on the Excel-DNA Google Group.

If you want to read the .xll version that was updated by 'verpatch' from VBA, you be calling the WIN32 version API from VBA, which is discussed in KB article 139491.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top