0

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!

user1984867
  • 41
  • 1
  • 1
  • 5

1 Answers1

2

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.

Govert
  • 16,387
  • 4
  • 60
  • 70
  • Thats a good suggestion.For some reason my VB.net project(to which I added ExcelDna package) stops producing .xll file after working on it for some time..I cleared the cache in Temp folder also..What could be the possible reason for this? – user1984867 Jan 24 '13 at 20:53
  • It even says ExcelDnaPack.exe stopped working...But it did this after I worked for some time.I have seen in many posts that the .dll ,.xll and some other files have to be in the same directory..I am not clear on this...Would really appreacite help... – user1984867 Jan 24 '13 at 22:24
  • Best is to post the output of ExcelDnaPack to the Excel-DNA support group on Google Groups: http://groups.google.com/group/exceldna – Govert Jan 25 '13 at 12:17